Pythagoras is believed to have come up with the just intonation (exact rational) figures. At the time, irrational numbers were distrusted and despised so, as you noted, the perfect fifth really was exactly 3:2.
But it’s likely that a 12-tone system won out because lg(3/2) is so close to 7/12, even if this was never a conscious decision. 19, 31, and 53 are also credible candidates per continued fraction expansion, but unwieldy for physical instruments (although some computer music does use 53-TET).
Pythagoras and his followers at first thought that irrational numbers didn't even exist, though the story that they drowned a guy for proving by contradiction that sqrt(2) is irrational is probably not right. Rather, strings with length ratios made of small integers, like 2/3 or 3/4, sound good (harmonize) when played together. So the started with the ratios, because that's what made sense. Not to use ratios was considered, well, irrational. :-)
But it’s likely that a 12-tone system won out because lg(3/2) is so close to 7/12, even if this was never a conscious decision. 19, 31, and 53 are also credible candidates per continued fraction expansion, but unwieldy for physical instruments (although some computer music does use 53-TET).