I can't give a full answer, but here's the start of one.
"Achat" (אחת) is structurally an adjective, with the "-at" one often finds as a suffix. So it makes sense that it follows the usual rule for adjectives -- "achat" with the feminine suffix is used for feminine nouns.
The fact that "echad" and "achat" are adjectives whereas the other numbers aren't may explain why Bereishis one goes from the cadinal "yom echad - one day" to the ordinal "yom sheini - second day", "yom shelishi - third day", etc... The numbers above 1 are grammatically different in kind than the others.
Also explains why there is no ordinal "echadi", it's "rishon" (first).
Two is also unique, as "shtayim" and "shenayim" come with their own suffix for a pair "-ayim" built in. We don't get that until "esrim" (20), which actually is multiple tens. (Although it's weird that 20 isn't "esrayim -- a pair of 10s".)
Because shenayim/shtayim is a noun, we use semichut to make a phrase. "Shetei yadayim -- two of hands", following a construction like "Benei Yisrael -- children of Israel". But the semichut does require gender to match.
(Another language oddity with "shtayim" is that in proto-Semitic it was "ashtayim", with a leading syllable we still see in "ashtei asar". So, the word is "shtayim" and "shtei", with the sheva under the shin a silent sheva nach.)
Now we get to your question... Numbers above 2.
Now we get to nouns (unlike echad/achat) that don't have the plurality suffix built in (unlike shenayim/shatyim). And why does the form used with masculine nouns have the usual structure for feminine words, and vice versa.
Well, the first part of the answer I do have is that they're nouns, not adjectives. So there is no rule about the genders having to match. "Shalosh" means more like "a set of three" than just "three". "Sheloshah avos -- a set of three, all forefathers."
As for the second half, I'll share what's just a guess: How do you pair nouns? Well, human couples (at least as halakhah recognizes them) come in male and female pairs.