As I understand it, that description of the British navy is misattributed to Winston Churchill. Regardless of who said it, the fact that it stuck and no one found it preposterous makes me suspect homosexuality wasn’t terribly uncommon in the British navy.
Was it commonplace? And if it was, was it akin to homosexuality in prison, where gay sex is better than no sex? Or was the navy a Mecca for gay men in a homophobic society? Or both?
This answer draws largely on a couple of answers I've previously written about how gay and LGBT men experienced the RN during WWII, as well as an answer on LGBT women in the WRNS in the same period, largely because I've seen little new information on it. At least at the time when Churchill was First Lord of the Admiralty, corporal punishment had been largely suspended within the Navy, and the daily rum ration reduced by a quarter compared to its heights in the Napoleonic period. The use of the cat o' nine tails for punishing adult sailors had been suspended by the RN in 1881, though corporal punishment for boy sailors through birching or caning (both common in schools at the time) lingered. The daily rum ration in the Napoleonic period was a half pint, cut to an eighth of a pint by the start of the twentieth century.
This leaves the last leg of the trio, which is much less well covered by the historical record. Social histories of the RN written by naval historians tend to, where they do discuss homosexuality, use the memoirs and recollections of heterosexual sailors. This means that their descriptions are coloured by innuendo, rumour and stereotypes, and do not necessarily reflect the real experiences of LGBT sailors. A more useful, taken by Matthew Seligmann in his Rum, Sodomy, Prayers, and the Lash Revisited, is to look at medical and court-martial records. This gives a more reliable look at the topic, especially in periods like the early 1910s when we have little personal testimony on queer experiences in the Navy. However, it is also necessarily a less personal one, coloured heavily by official homophobia, and cannot really give a deep insight into the experiences of LGBT men in these periods. Histories of LGBT servicemen, meanwhile, take a more general view, looking at all three services, which means they may miss some of the intricacies of naval life and culture. Historians writing such studies also frequently face opposition and obstruction from the veteran's groups they need to work with to contact LGBT servicemen, limiting the extent to which these works can cover the issues. As a result, this answer will, necessarily be limited by this lack of source material, meaning that I will primarily be focusing on WWII, rather than taking a more general view.
As a second historiographical note, we cannot necessarily extend modern concepts of sexuality and gender to these periods. Many of the sailors who engaged in sex with other men were married to women. While we might now identify these men as bisexual, they would have identified themselves as straight to others in their society. Equally, they did not have the same understanding of gender identity - some of the people discussed in this answer, might, if living now, identify as trans, but did not necessarily have the ability, understanding or vocabulary to do so at the time. To avoid presentism, queer historians use the term 'homosex' to describe sexual activity between two people of the same sex. I will follow this practice in this answer.
Legally speaking, queer men were banned from serving in the Royal Navy until 2000. Despite this, it was able to maintain a reputation for homosexuality, hence the inclusion of 'sodomy' in the maxim in the title. Given this dual reputation, it should not be surprising that the experience of many queer sailors was similar. They had to hide their sexuality from senior officers, censors, medical boards and other representatives of the navy's institutions who might disapprove or punish them, while being able to be more free and open about it with their shipmates. Many accounts describe this tension, between 'passing' and openness, and it should always be kept in mind when discussing the topic.
Naval punishments could be harsh when it came to homosexuality. Section 45 of the Naval Discipline Act stated that "If he shall be guilty of Sodomy with Man or Beast he shall suffer penal servitude", a charge second only to the death penalty. However, in most cases, less serious punishments were preferred, using lesser charges, or discharges for medical reasons and 'services no longer required'. Courts-martial for such offences were pretty much life-ruining. In 1939, the First Lieutenant of Hood, accused of an indecent advance towards a junior seaman, chose to commit suicide rather than stand trial. However, the Navy was also somewhat more tolerant than either the Army or the RAF. Over the course of the war, 32 RN officers would face a court-martial for indecent offences, of which just 20 would be convicted. The Army prosecuted 161 officers for the same charges, with 103 of these being convicted. The Navy was often unwilling to bring courts-martial, especially for officers. These were public affairs, which could be damaging to the service's reputation; instead, officers accused of homosexuality were often discreetly but firmly encouraged to resign from the service. Officers were willing to overlook transgressions of the rules around sexuality, especially for men who were seen as valuable to the ship's functioning. For example, Dennis Prattley, a signalman aboard an RN destroyer, was kept in the Navy despite admitting his sexuality to a number of officers and medical examiners. That said, ships' doctors were one of the RN's main systems for identifying queer men. As men would visit them for treatment for STDs, examinations prior to these treatments could reveal that they had been having sex with other men, and so medical officers were encouraged to provide such information to their seniors.
While queer men had to hide their sexuality from naval institutions, they could be more free with their shipmates. Many were willing to overlook their comrade's sexuality as long as they were good sailors. A. W. Weekes described a typical naval view:
‘You accepted the chap as he was. If he was a good messenger or a good pal. [Non-sailors] can’t understand the passionate feeling about sailors collectively.’
Others might well view it as a joke. Sailors aboard HMCS Sackville would apparently laugh when they encountered their shipmates in a mutual embrace. Some queer men might well play up to this stereotype as a way to break tensions and establish a space for themselves. Freddie, a coder aboard a British corvette, used impersonations of well-known personalities like Gracie Fields and Vera Lynn to prevent rising stresses. Homosexuality was often understood as one of the little infractions, the petty crimes, that crews would get away with. Covering up the actions of their shipmates was a way to mock the naval authorities, and helped to develop an esprit-de-corps. While they had some support from their comrades, gay men often had to prove their status. Sub-lieutenant John Beardmore, a queer RN officer, felt that
[queer] men were very often much braver than straight men because they had … the feeling that they had to make a stand to prove themselves … I know many cases where queer men went, paid enormous risks and were totally without fear’.
Others chose to defend their sexuality with humour. Terry (or Terri) Gardner, an RN cook who was very explicit about his sexuality, felt that this was a key part of his ability to fit in to the crew:
People were just thankful to get through the day and if I was there to give them a laugh, it was a bonus, wasn’t it.
While he faced hostility for his sexuality, he would respond to this in a crude, mocking way, establishing his place in the crew. The lower deck was not always so accepting. Sailors would often disapprove of relationships that transgressed the boundaries of rank. Such relationships were often seen to result in favouritism, and caused bitterness. Acceptance also varied from ship to ship, with some being more or less willing to overlook sexual transgressions.
The RN's systems created spaces where queer men could exist, and find companionship. One key area was the 'wingers and oppos' system, a way of mentoring and training new recruits. Wingers were older men, while oppos were seamen at a similar level in terms of age and rank to new sailors, with both being assigned to mentor new seamen. This mentoring created a relatively close relationship, that could often develop into a companionship or sexual relationship. When the Navy wasn't fighting, concert parties, or 'Sod's Operas' were common. These had all-male casts, but often had female parts, for which men had to cross-dress. Queer men often used these parts as a way to perform and experiment with new expressions of their gender. Some might even become full-time performers, and win exemption from their duties.
Homosex was surprisingly common, especially on the lower decks. In Jackspeak, the RN's habitual slang, a 'flip' referred to the act of masturbating another sailor. That this made it into naval slang suggests that it was common and fairly well understood. Recollections from veterans support this. John Beardmore described the situation aboard the corvette HMS Poppy:
Sailors were a fairly randy lot and masturbation was not at all uncommon. You could go down in the middle watch which was twelve midnight to four and hear a whisper come from a hammock, someone saying “Give us a wank
Many saw this as being preferable to catching an STD from a prostitute ashore or going without sexual release on long voyages. Others took things further, especially with men who were out homosexuals. Such men might be seen as a sexual and emotional surrogate, a way to compensate for the lack of women and distance to home. Dennis Prattley described men climbing into his bunk for sex; they would often tell him that he reminded them of wives and sweethearts at home. He felt that this helped draw him into the crew as much as his performance of his duties during the day.