A former commander of the Navy’s elite Blue Angels flight demonstration squadron has been reprimanded after an investigation found he repeatedly failed to stop sexual harassment and condoned pornography, homophobia and lecherous behavior in the workplace.

Capt. Gregory McWherter, who served as commander of the Blue Angels in two stints between 2008 and 2012, was found guilty after a disciplinary hearing Monday, the Navy announced. He was given a letter of reprimand that will most likely end his Navy career, officials said.

A 63-page investigative report released by the Navy found that McWherter tolerated and encouraged a sex-obsessed environment in which Blue Angels pilots kept pornography in the cockpits of their jets and even painted a giant phallus on the roof of a trailer at their winter training home in El Centro, Calif.

The painting was rendered in blue and gold — the Blue Angels’ colors — and was so large that it was visible on satellite imagery available on Google Maps, according to the report. It has since been painted over.

The investigation of McWherter’s Blue Angels command found a pattern of other unethical behavior more typical of an “Animal House” fraternity than one of the most respected units in the U.S. Navy.

Hazing used to be common, and new arrivals were forced to wear “foam penis” hats. Pilots kept binoculars in their jets to ogle bikini-wearing women in air show crowds. Crew members for a time were allowed to buy custom-made Breitling watches at a cut-rate price of $500 — a fraction of their retail cost. The report didn’t specify who supplied the watches.

McWherter, whose pilot call sign was “Stiffy,” formerly had a cherished reputation in the Navy. A graduate of its “Top Gun” fighter-pilot school, he was brought back as Blue Angels commander in 2011 to restore order and morale at the unit after it was temporarily grounded for performing a dangerous stunt during an air show.

He also served as president of the Tailhook Association, the nonprofit fraternity of Navy aviators, until the investigation prompted him to resign last month.

The Navy’s investigative report was unsparing in criticizing his leadership after it found repeated evidence of raunchy locker-room antics.

“This Commanding Officer witnessed, accepted, and encouraged behavior that, while juvenile and sophomoric in the beginning, ultimately and in the aggregate, became destructive, toxic, and hostile,” Adm. Harry B. Harris Jr., commander of the Navy’s Pacific Fleet, wrote. “He failed himself, failed those that he led, failed the Blue Angels, and failed the Navy.”

McWherter declined to comment through a Navy spokesman. He was relieved of command in April from his job as executive officer of Naval Base Coronado near San Diego and was temporarily reassigned to other duties pending the outcome of the investigation.

The Blue Angels perform thrilling maneuvers at air shows across the country and have iconic status in the Navy, for which they are a key recruiting tool.

The Navy opened its investigation in March after receiving a complaint from a former member of the Blue Angels, alleging sexual harassment and other problems under McWherter’s watch.

The report redacted the name of the complainant. No female pilot has ever flown as a member of the Blue Angels, although the team has had numerous women serve in support roles.

According to the investigation, some Blue Angels never expected that to change. In 2010, a lieutenant commander told a reporter for a Pensacola television station — in a conversation that was not broadcast — that the reason there were no female Blue Angels pilots was that “women want to have babies.”

Other pilots laughed. The complainant cited the remark, along with similar jokes and comments, as evidence of sex discrimination.

The investigation found relatively few problems during McWherter’s first stint as commander but said he encouraged a “sexually charged” workplace from 2011 to 2012.

For example, the Blue Angels set up a messaging group on their smart phones in which they swapped pornography — especially pictures of male genitalia — and engaged in “vulgar, homophobic” chats,” according to the report.

When one team member complained about pornography kept in cockpits, McWherter replied that it was “appropriate because it reflected a special trust shared between the pilot” and the crew.

The report said McWherter grudgingly ordered an end to the practice after someone filed an anonymous complaint with the commander of Naval Air Station Pensacola, home of the Blue Angels.

The report states that five other members of the Blue Angels squadron were investigated. A Navy spokesman said some former Blue Angels personnel received “formal written counseling” as a “non-punitive measure” but declined to say how many.

Several witnesses told Navy investigators that they saw nothing improper with the Blue Angels’ culture and defended McWherter’s leadership. Investigators concluded those witnesses “were either blind to the standard of what constitutes sexual harassment, oblivious to the things around them at the time, or otherwise biased towards support of CAPT McWherter at all costs.”