Oh, Thomas Barrow — you make it quite hard to feel compassion toward you — even when you're struggling against unjust laws and societal pressures. Thomas is still trying to "cure" his homosexuality on Downton Abbey, but what were the actual legal repercussions of being gay in 1920s England? Pretty much everyone who lives or works in Downton Abbey knows that Thomas is gay. Even Lord Grantham knows that Thomas is homosexual, and to his credit (since he can be a judgmental, antiquated snob at times), he has continued to keep Thomas employed. (Even though the family really should fire him for all of his unprofessional antics that have nothing to do with his sexual orientation.) While the family and household chooses to just pretty much ignore Thomas's sexuality — the British law at the time had a stronger stance. Being gay was actually illegal in 1920s England.
The first law making homosexuality a criminal offense in the U.K. was in 1553, according to the British National Archives. The punishment for sodomy was changed to life imprisonment rather than the death penalty in 1861. And though life imprisonment is an improvement over death, that was still a completely horrifying law. Then in 1885, homosexual men were directly persecuted by the eleventh clause of the Criminal Law Amendment Act (known as the Labouchère Amendment). It stated, "Any male person who in public or private commits or is a party to the commission of or procures or attempts to procure the commission by any male person of any act of gross indecency with another male person shall be guilty of a misdemeanor and being convicted thereof shall be liable to be imprisoned for any term not exceeding two years with or without hard labor."
One of the most famous men to be directly affected by the Labouchère Amendment was writer Oscar Wilde, who was sentenced to two years hard labor for gross indecency in 1895. Over its five seasons, Downton Abbey has covered the time periods of 1912 to 1924 and considering it took until 1967 (!) for homosexuality to become legal in the U.K., it's understandable that Thomas accepting his sexual orientation is something he has been struggling with his entire life. (And in case you were wondering, the U.S. really wasn't much better than England with Illinois becoming the first state to decriminalize homosexuality between adults in private in 1962.)
Now back in Season 3, when Jimmy came to Downton, O'Brien convinced Thomas that Jimmy had feelings for him. Thomas kissed him and it led to a scandal with Alfred getting the police involved. The police arrived at Downton during a cricket match (oh my!) and Lord Grantham saved the day by telling Alfred he shouldn't ruin Thomas's life for something that he can't control (which was really progressive of Lord Grantham). By telling the police it was all a misunderstanding, Thomas was able to keep his job — and stay out of jail.
Thankfully, most of the people are willing to overlook the fact that Thomas is gay. (Of course, I'd rather they accept it, not overlook it, but that would be unrealistic for the time period.) He has been looking awful from the drugs he is taking to change himself, so I hope Baxter does convince him to stop. The only issue is that it appears Thomas is going to take advantage of Baxter's sympathy for him and have her go to the police about what she knows about Mr. Green, Anna, and Bates in the sixth episode of Season 5.
Damn you, Thomas! Every time I feel bad for you, you go and do something that makes me angry again. I don't want you to be arrested for your sexual orientation, but maybe you could be arrested for being a terrible jerk? That'd be far more reasonable.