In the UK Employers cannot pay a man more than a woman for doing the same job under the Equality Act 2010.
Its not as clear cut as that. If a company can justify that its not based on gender, its legal.
The colleague could have asked for more and the op may not have.
He may have been there longer
Despite being less qualified, he may have some skill that is important.
It could be discrimination. But its not as simple as 'men can never be paid more for doing the same job'
I get paid more than everyone else who is the same level in my office. I am a woman. Because I told them I wouldnt move to them for the amount they wanted to pay. So they gave me what I asked for.
When they asked me to do a sideways move but with more responsibility, i refused unless it came with a pay rise.
People in the office know i am paid more and blame it on all sorts of reasons. Non of which is the truth. The truth is that I know I am valuable to the company and know my worth. I expect them to pay me what I am worth and make sure they do.
The others dont feel comfortable talking about money, asking for raises, sometimes arent great at their jobs so dont have a case for a raise. Lots of reasons.
But non of that is discrimintation or my fault. People need to their situation inot their own hands. Or prove its discrimination.