I'll give you a hypothetical.
You run a shop that sells clothes to children. You have an employee who is attracted to underage children. They don't do anything strictly illegal (no abuse, photos etc), but they discuss their interest in children on messageboards or the like. This information becomes public knowledge.
Under your standard - "Thou shalt not differentiate humans based on what they do at home, what they did in the past, what they say in private, where they came from, whom they came from, et cetera.", you would not be allowed to fire this person or deny them a job in the first place.
I think it is reasonable to say your business wouldn't exist for long, given that customers ARE allowed to discriminate about which store they go to.
The only way you can justify this is by saying something like "ah well, my business would suffer (to the point of closing), therefore this employee isnt as good as an employee who isn't a paedophile." This, of course, makes perfect sense. In a purely meritocratic society, you wouldn't hire any paedophiles to work in a kid's clothes shop. Easy then, the law can be meritocratic.
But hang on, wait a second. Lets think about this. Lets go back in time 50 years and move to the South. You run any shop and you have a black guy working for you. Your foot traffic goes down. Oh, I guess black people arent as good at working in shops in the South as white people then! By the meritocractic standard, its ok to not hire any black people in your store. Hmmm... wait a second... that's probably not what you were looking to achieve is it?
We have, as a society, decided that protecting people based on certain characteristics is more important that strict meritocracy. As demonstrated above, those characteristics can not be all encompassing to me meaningful. As a result, we have to build a whitelist as best we can and go from there.