Private schools can discriminate and it has nothing to do with "merit". It mainly has to do with money.
Of course, private schools can select their students based on any criteria, just as consumers of a private school education make choices based on anything (religion, gender, sports program, etc.). But, to say merit is not a main driver is not correct. I don't think a private school will survive with the slogan "We're just as lame as the pubic school down the street. Give us another $15,000/year." No, they generally offer something else to garner a critical mass of customers willing to pay the extra price. And most of the time it's a better education.
Public schools have to teach any student that walks through the door. Private schools don't, they can turn them away.
Likewise, most parents have to send their kids to public schools because their money is automatically sent there. They have no extra to also buy a private school education. They have to accept whatever quality of education the government and unions provide. If they could shop around in a competitive market (and take their money with them), the more intelligent non-wealthy kids could get a better education.