I'll begin with a simple analogy.
Your house is for your family, including children who have never done anything to earn it. Why can't other people come in, eat your food, watch your TV, and sleep in your bed? Why should other people, or other children, not have the same rights to your home as your children do, just because of the circumstances of their birth?
II
So, you can see that "one shouldn't be discriminated against based on one's circumstances at birth" is not actually a universal principle at all. It's a general goal, but must be tempered by other concerns.
In this it's like honesty - as a general goal, we should try to be honest. But being 100% honest every moment would be foolish and harmful. Morality is more complex than applying simplistic rules without exception.
III
People have communities which they care about more than other, more distant communities. Your family, then your neighborhood, your city, your province/state, your country, humanity, all of life. You can mix in your tribe (if you have one), language group, class, race, sports team fans, or whatever else you like in there. The point is that an eternal part of human life, since our earliest beginnings, has been to form concentric in-groups with loyalty and concern falling off as you move away from the self.
Why? Since other people are loyal to you the same way, that creates the possibility of a mutual structure - a tight family with strong loyalty in both directions, then a country of people with good mutual loyalty, then a world of humans who care about each other somewhat. We all benefit from this, and it's also sustainable.
If you want to be suicidally moral, you can start treating every human as well as you treat yourself. In some sense, I'd applaud you. But what you're doing won't last and won't have a long-term impact on humanity. You'll rapidly exhaust yourself as you give away your resources while nobody gives anything to you. In the end, your behavior will be wiped out by unstoppable Darwinian forces.
If you want to be sustainably moral, you need to set up loyalty and care that runs reasonably symmetrically across relations, so it can be maintained that way.
Because morality is not absolutes. It is a negotiation between Darwinian principles and our desire to be more than apes, murdering and raping and pumping out as many kids as we can. You cannot ignore either side of this fundamental tension.