Why number 2 has two forms?
A counterexample: in the Min Dong topolects, there is a similar distribution for the numeral "one", viz 一 and 蜀 (in Fuzhou, pronounced ék /ɛiʔ²⁴/ and siŏh /suoʔ⁵/ respectively). This is actually replicated across the other Min topolects (Min Nan has it vs chi̍t), although they are usually written with the same 一, especially in the Taiwan Ministry of Education standard for Taiwanese Hokkien. This comes from a well-known split between colloquial and literary pronunciations. For numbers above 10 however (11, 12, 21...) the literary pronunciations are generally used, even in counting before measure words.

Concentrating on the 二 vs 两 distinction: this seems to have emerged from Classical Chinese of the late Zhou, where it already had the meanings of "both/pair" (see the Analects), as well as starting to be a measure word for a chariot (see Mencius and the 詩經 Classic of Poetry). This is before most measure words have come into existence. Its use as a "tael" (measure of weight) is also ancient, but probably from a different derivation of the word (Min topolects have a separate pronunciation for this word).

So where did these two very different "twos" come from? "Pair" as a separate word to "two" is well-attested in many languages. But language change can bring such words together and cause them to change role. Here, it was likely the development of the measure word system through the Qin &amp; Han dynasties to the Song dynasty, where numerical 二 came into a system (associated with nouns) that 两 (as pair) was already associating with. Hence in this case, 两 was already in the role and won out, whereas other numerals (including 12, 22 etc. with 二) took on the "measure word" role for the first time.