Someone will always lose out, but if positive discrimination is fairly applied (which legally it has to be) then the people who lose out do so because they start off at an advantage over the 'favoured' group, which usually means that men have traditionally had an advantage over women, and that balance is being redressed.
Of course it's hard lines if you don't get the job you really want because the company has an unbalanced workforce. That's not your fault, and it's only natural to be narked - but in theory at least you should be well placed to get another one. Was your son told that this was why the other candidate was successful over him? That seems harsh, and quite unusual, I think, as positive discrimination can only be applied if all else is equal and it is the only way of choosing between the candidates. As a mother, I would probably have felt as you did if my son were certain that he didn't get a job for that reason, but as a feminist I wouldn't see it as one person losing out, but as a situation where the female candidate got the advantage that would usually go to a man. It's not always easy to hold both points of view at once, of course - I do realise that.
Personally, I think that positive discrimination can be a bit of a blunt instrument. In some areas, for instance, there are fewer disadvantaged groups than in others. An employer in a city centre might be drawing on suburbs with very different demographics for staff, so it's debatable which profiles should apply.
On the whole, though, I think that it is a good thing to make employers think about why some groups are under-represented and what can be done about it, and in some cases it is absolutely the right thing to do, because of the nature of the organisation and its clients.
If the ERC felt that all employees should be female, or that particular roles should be advertised as open to female candidates only, then (assuming they stayed within the law), I think it is very important that they should be able to do so and have that respected. Whether in this case a transwoman would be equally suitable is not for us, as outsiders, to decide, but it should have been put to the interviewers for consideration, and not circumvented by deceit.