只 zhǐ is just simply 只 zhǐ in simplified writing.
As far as I can tell the most common traditional form is 衹.
Why so many variations for traditional 只 zhǐ (衹/祇/秖/隻)?
So what you're really asking can be split into multiple questions:
Why are there multiple zhǐ (only) characters?
衹 is the correct one, but due to close similarity with the other characters, they have often been confused for each other. Over time the other forms have become accepted as also having the same meaning.
Just to demonstrate how confusing this can be, the character 祗 is also mistakenly used; it even has a similar pronunciation (zhī). If you haven't noticed, the only difference is a dot below the right part: 氐
One of the goals of simplification had been to eliminate multiple characters meaning the same thing, so it's easy to see why these three were merged into 只 (zhǐ). According to 說文解字, 只 emerged as an alternate form of 衹 as far back as the Song dynasty ("宋人詩用只爲衹字"), explaining why 只 was chosen. But this leads to the next question:
Why did 隻, unrelated and pronounced differently, also get merged into 只?
That's harder to answer as it's one of the controversial aspects of simplified Chinese: 一简对多繁. For whatever reason, in 《通用规范汉字表》 只 was listed as "low risk" (低风险多音字). Probably because the two meanings have different pronunciations and have different grammatical functions, and therefore were unlikely to be mixed up. This is unlike the "high risk" characters like the infamous 干, which has confused computer translators into translating it as "fuck" on many Chinglish menus.
My guess is that they wanted to simplify 隻, a very commonly used character, but there were no good options - e.g. they could have used 支 but it is already a different measure word, which could cause confusion.