What I don't get is since the IOC knew the two were men, having known about the banning in Tokyo, why did they allow the two men to compete in Paris.
Because the IOC's eligibility criteria for the women's category is different to the IBA's (or other boxing governing bodies). They base eligibility on gender identity, of which an F on the passport is sufficient proof. The IOC decided after the Tokyo Olympics (and the furore around Hubbard) that Inclusion should be their top priority, and second priority was avoiding harm to anyone's identity. There is a list of priorities in the framework document which they issued after Tokyo. Fairness and safety for women features nowhere in it.
So the women's category is no longer a sex category as far as the IOC is concerned. Therefore they are not interested in the results of a sex test because sex is irrelevant to eligibility for the category, even for a combat sport like boxing.
They are not prepared to say so out loud, because they know it would not go down well.