Discrimination is around things that an individual can't choose (religion being the weird elephant in the room). Fair or not, this isn't discrimination.
Pregnancy, maternity, marriage, civil partnerships and gender re-assignment are usually chosen by individuals, not forced upon them.
(Stress on might and some, probably still not enough in may rich countries to stop native population from shrinking.)