Democratic presidential candidate Hillary Clinton is not alone in being sloppy with classified information on her computer during the war on terrorism.

The Marine Corps was too.

A Marine officer fighting dismissal for mishandling classified material on his computer has filed a complaint in federal court. He charges that Marine generals unfairly singled him out, citing statistics that show Marines often wrongly stored classified information and went unpunished.

Marine Reserve Maj. Jason Brezler’s lawsuit does not mention Mrs. Clinton, whose handling of secrets on her private server as secretary of state is under FBI investigation.

But legal observers say that if the military can impose harsh punishment on a war veteran for keeping secrets in the wrong computer, then the FBI, in fairness, should cast a critical eye on Mrs. Clinton and her stash of information that the intelligence community says contained top-secret data.

“Brezler was treated in an entirely disproportionate way,” his Manhattan attorney, Michael J. Bowe, says in an April 25 complaint that aims to persuade a judge to overturn a Marine Corps decision to oust him.

Charles Gittins, a former Marine and criminal defense attorney, said Mrs. Clinton’s mishandling “was a far more egregious violation of law.”

“Maj. Brezler violated regulations by maintaining classified information on a personal laptop computer,” said Mr. Gittins, who is not involved in the case. “My personal opinion is that his was a minor infraction that resulted from combat conditions that didn’t allow access to classified systems.

“Hillary Clinton, on the other hand, as secretary of state, had access to all of the systems meant to protect classified information, and she and her staff knowingly stored secret and top-secret information on an unsecured server.”

Maj. Brezler is the officer who, while a graduate student in Oklahoma, sent a warning email via his laptop to intelligence officers in Afghanistan in 2012. He messaged that Sarwar Jan, a corrupt Afghan police chief, should not be allowed to stay on Forward Operating Base Delhi. Jan smuggled arms to the Taliban and sexually abused boys, Maj. Brezler’s dispatched dossier said.

Maj. Brezler had played a role in kicking Jan off another U.S. base while deployed in-country.

His warning went unheeded. Two weeks later, one of Jan’s “tea boys” walked into the base gym and fatally shot three Marines in cold blood. The killer proclaimed he was carrying out jihad.

For Maj. Brezler, that email may prove his downfall. An intelligence officer in Afghanistan reported him to higher-ups for sending classified information over his personal laptop. A Navy criminal investigation found he had other classified documents stored there.

Commanders at his reserve unit in Brooklyn, New York, where he is a firefighter, punished him administratively. Seemingly, the case was closed.

But when the Marine Corps Times reported he had gone to a congressman from New York as a whistleblower, an angry top brass, all the way up to the then-Commandant Gen. James Amos, interceded. The next thing the officer knew, he was before a board of inquiry. After a hearing, it voted to kick him out.

That turn of events has brought Maj. Brezler to the U.S. District Court for the Eastern District of New York.

The grounds: His attorney, Mr. Bowe, argues that the board of inquiry was a “kangaroo court” with members doing the top brass’ bidding by excluding defense evidence and accepting government arguments for which there were no facts to back them up. The complaint also argues that the material was storied in his laptop because in Afghanistan there was a shortage of classified-ready computers.

Mr. Bowe also said Maj. Brezler is being singled out for something other Marines have done yet faced little or no punishment.

The complaint says Maj. Brezler is the only reservist referred to a board of inquiry for “spillage,” the official term for the migration of classified material, in the war on terrorism’s entire history.

The lawsuit says there are on average 83 reports of spillage in the Corps each year. There were 280 reported violations by all U.S. forces in Afghanistan in 2012, with only two resulting in any discipline.

The lawsuit adds: “Indeed, sources familiar with Navy and Marine Corps practices have related that in any given year there are thousands of document self-reports and no self-reports that result in no significant action being taken, and that Marine Commanders routinely disclosed classified information on par with that possessed by Maj. Brezler while in the presence of imbedded journalists and Iraqi or Afghan allies without consequence.”

Rob “Butch” Bracknell, a former Marine attorney who is not involved in the case, agrees that most cases of mishandling data are handled administratively.

“The crusade against Brezler is perplexing, particularly considering his disclosures of classified information over unclassified networks had such a noble purpose, to protect Marines who were in danger,” said Mr. Bracknell, who specializes in international law. “Either the government has simply decided it can’t back down and is trying to save face, or there are some undisclosed facts about Brezler’s conduct that aren’t in the public record. I’m betting on the former, but concede the latter is possible.”

Mr. Bowe says he knows the reason for the harsh punishment: Maj. Brezler’s case is intertwined with the massacre at Camp Delhi. (Mr. Bowe is representing the family of one of the three murdered Marines, 21-year-old Cpl. Greg Buckley Jr.) Marine higher-ups were embarrassed by the lack of security. Then Maj. Brezler came along and tried to put a spotlight on how the deaths could have been prevented.

“The procedural history of this inexplicable prosecution demonstrates that it is driven by an obvious intent to silence and discredit Brezler because he knew the facts the Marines wanted covered up and, when requested, was willing to do the right and honorable thing and assist the Buckley family and members of Congress in securing that information,” Mr. Bowe said.