I personally agree re athletes should stop when they are discovered to have XY chromosomes.
However I also think that Khelif is likely to sincerely identify as a woman (as she was raised) and feel she has a right to be there. Her belief that she has a right to be there will have been reinforced by her cultural background, her coach, everyone that has supported her, and indeed it seems the Olympics officials - so it isn't like she's completely alone. She will have worked hard. She will have to sacrifice a lot to let go of the belief that she should be there. It's not something everyone can do. Many/most of us protect our beliefs even when they are wrong. Even more so when there are incredible personal incentives for doing so and if there are massive sunk costs.
That is not to take away from the work and sacrifice of other female athletes such as Angela Carini - I truly feel for her and believe she has been failed terribly as have the other female boxing competitors. This should not have happened the rules should be clear. Imane Khelif should have quit women's boxing as a teenager when her DSD was discovered.
Nevertheless she did not choose to have a DSD or to be raised with a female identity.
I disagree with Khelif's (in this case presumed, but let's go with it) belief that she should participate in women's sport. I agree (with you) that it is not safe, fair or in the interests of women's sport as a valid competition for her do so.
But I don't need for her to be a 2 dimensional villain for that to be the case and I really think it is very unnecessary and hurtful to repeatedly refer to her as a man when she has a DSD and was raised with and clearly maintains a female identity (this is very different in my opinion to being a biologically normal male raised with a male identity and then adopting a female one). I think society (if not women's sports for overriding reasons of safety, fairness and integrity of the sport) can make some accomodations to the very very few number of people with XY DSD and identified as female at birth, an already very stigmatised (and surely traumatising if diagnosed at puberty) condition. Least of all, allowing them to continue the female identities they have possessed for their entire lives.