What you did was definitely illegal and immoral. It is not your decision to make on how someone should live their life.
It was possibly immoral, if you think there's a moral requirement to hire the first person that fits the role. Though, employment is a relationship, and like any relationship there can be a host of reasons why they don't start or work out. It can simply be a matter of preference, on both sides.
It's not illegal to discriminate, it's illegal to discriminate for particular classes.