A former counter-terrorism officer who told police bosses about racism and homophobia in the ranks has alleged that Scotland Yard hounded him out of the force "like an enemy of the state".

In his first interview, former detective constable Kevin Maxwell told the Guardian he was sacked after raising concerns about racist and homophobic behaviour by some counter-terrorism officers. They also picked on members of the public, subjecting them to searches based on their skin colour or nationality, which amounted to racial profiling, he said.

This week the Met lost an employment tribunal appeal against an earlier ruling, which found in Maxwell's favour on at least 40 points.

The tribunal found that Maxwell, who is black and gay, suffered multiple counts of degrading or humiliating treatment. One officer talked of gay men "taking it up the arse", and the tribunal found that one officer described a man in a photograph as being "as gay as a gay in a gay tea shop", which police colleagues greeted with laughter.

Maxwell, 35, told the Guardian he had dreamed of being a police officer since the age of five, but has now been left financially ruined and suffering from severe depression, which he says was triggered by the Met ignoring his concerns and trying to punish him for raising them, even though he did so privately.

His case prompts questions about the Met's commitment to tackling prejudice among officers. But it also raises concerns about the police's treatment of whistleblowers and undermines claims from top officers that they can sort out wrongdoing without officers having to go to the press.

The tribunal also found that a Met employee had leaked details about Maxwell to the Sun newspaper, which he says endangered his safety.

In February 2012 he won his first employment tribunal victory. After this the Met started disciplinary proceedings, sacking him in December 2012 for "gross misconduct" after he went off work through illness after repeated episodes of racial and homophobic harassment.

In his interview this week, Maxwell said: "What did I do that was so bad to be treated like an enemy of the state? I wanted to make the police service better and they don't want to learn.

"I am not the first black or Asian officer to say this. I thought if I went to them, I thought they would believe me, that I meant well."

Maxwell joined Greater Manchester Police aged 23, and in October 2008 joined the Met, winning a posting to its elite counter-terrorism command, SO15, stationed at Heathrow airport.

He says he suffered homophobia and racism in the Manchester force, but it was much worse in the Met.

"The Met make GMP look like a kindergarden. I don't want to hurt the Met, I just want to say this is where they are going wrong and still going wrong."

The Met spent tens of thousands of pounds in public money launching an appeal against the employment tribunal finding. This week it lost after a judge ruled against it again.

Maxwell first complained in July 2009 about racist and homophobic abuse but then went on to tell his bosses, still privately, that officers were abusing their sweeping powers of stop and search.

The tribunal found that white officers had "asked the claimant on several occasions to act as a "buffer barrier" by stopping black and Asian people for them first, and then to hand the person over to them because "blacks don't complain about blacks". The tribunal upheld his complaint that this was "racial profiling and asking the claimant to be involved in it caused the claimant great offence and anxiety".

Maxwell said he could not stand by and say nothing as people were stopped for no reason, which he feared would fuel resentment: "I said we should be catching terrorists, not creating them."

The tribunal ruled that Maxwell had suffered homophobic abuse when in March 2009 a DC Howarth "made comments about gay men 'taking it up the arse'". The tribunal said the conduct had "the effect of violating the claimant's dignity or creating an intimidating, hostile, degrading, humiliating or offensive environment". Maxwell also suffered racial harassment when a white officer referred to an ethnic minority officer as "being one of those people", it found.

The tribunal also found that a DS Addis, during a presentation to officers in June 2009, put up a picture of a man at a fairground surrounded by children and said he was "as gay as a gay in a gay tea shop". The tribunal ruled: "The comment having been made, other people in the room, including other supervisors, laughing and finding it amusing, was inevitably conduct that any gay police officer would reasonably consider … degrading."

A chief inspector dismissed Maxwell's concerns that it was difficult being black and gay in the police, saying "that's life", amounting to racial and anti-gay prejudice, the tribunal found.

Maxwell was also found to have suffered other harassment, including after he went off work sick.

He told the Guardian: "I was pursued and sacked for whistleblowing."

The Met said: "The MPS is disappointed by the employment appeals tribunal's decision and will now take time to consider the detail of the judgment.

"Mr Maxwell's claims relate to events in 2009 and 2010. Since that time there have been changes across a number of areas including how to report wrongdoing and managing employees on sick leave.

"Any other learning opportunities identified from this case will be taken forward."

On the issue of his dismissal, the Met said: "The misconduct panel heard evidence that DC Maxwell had been absent from work without authorisation and had failed to comply with lawful orders without good reason.

"After careful consideration of the evidence presented he was dismissed without notice for gross misconduct."

Emily Thornberry, the shadow attorney general and Maxwell's MP, said the police should stop fighting the case. "The Met were going to lose and they were just being belligerent," she said.

"This is something the Met should be ashamed of."