Some haiku do not strictly follow the 5-7-5 pattern. Irregular haiku with one more or less morae than usual are called 字余り or 字足らず, respectively. Some haiku even ignore the 5-7-5 rule completely (See 自由律俳句).
Wikipedia says 一茶's haiku do have many variations:
最も多くの俳句を残したのは、正岡子規で約24,000句であるが、一茶の句は類似句や異形句が多いため、数え方によっては、子規の句数を上回るかもしれない。よく知られている「我と来て遊べや親のない雀」にも、「我と来て遊ぶや親のない雀」と「我と来て遊ぶ親のない雀」の類似句があり、これを1句とするか3句とするかは議論の分かれるところである。
According to 一茶の俳句データベース, the sources of these three variations are as follows:
- 我と来てあそぶ親のない雀 is from 七番日記
- 我と来て遊ぶや親のない雀 is from 句稿消息/etc
- 我と来て遊べや親のない雀 is from おらが春/etc
I think the third one is best-known, but it seems that the first one is the original version, although being 字足らず. 七番日記 is his personal diary, which he did not intend to publish.
According to the article of おらが春, 一茶 wanted to publish his poetry book, but he died before he could do that. おらが春 was compiled and published by another person, 25 years after 一茶's death.
『おらが春』は、まったくの時系列に沿って書き記された日記ではなく、刊行を意図して構成されたものである。さらに一茶自身、改訂や推敲を重ねたが、未刊のままに留まっていたものである。内容的には、一部脚色や時系列を事実とは若干ずらした箇所なども指摘する研究者もあり、作品として意識されたものという性格が強い。
So I think the well-known third version was the revised version either by 一茶 himself or by the editor.