Rep. Robert E. Bauman of Maryland was portrayed by law enforcement officials yesterday as a desperate man who for months frequented Washington's homosexual nightlife, driving from gay bar to gay bar in a car easily identified by its congressional license plates.

The Republican congressman's reckless indiscretion was such that one source familiar with his activity concluded that he was "crying out for help."

Bauman's odyssey ended yesterday in D.C. Superior Court, where, hands clasped behind his back and his head bowed, he agreed to enter a court-supervised rehabilitation program in the wake of a charge that he had solicited sex from a 16-year-old boy.

Bauman, 43, a third-term congressman from the Eastern Shore known for his conservative views, was allowed to plead innocent to the charge as part of his agreement to complete successfully a six-month period of rehabilitation. The program, often used for first offenders, will include alcoholic counseling for the congressman, who claims his problems stem from "acute alcoholism."

The entire court processing early yesterday morning ended in less than 15 minutes. Bauman was booked at the District's police headquarters, escorted to D.C. Superior Court Judge David L. Norman's courtroom and later driven out of the courthouse through a tunnel to avoid reporters.

"He is going to go on living," Bauman's attorney, Thomas O'Malley, told reporters. "The experience for Bauman has been extremely traumatic. He pleaded not guilty. He was put in the (rehabilitation) program as any citizen. He played according to the rules."

Bauman is scheduled to return to court on April 3, 1981. Prosecutors said yesterday the charge will be formally dropped upon his completion of the program.

According to law enforcement sources, the charge stemmed from an incident last March 2 when Bauman allegedly solicited sex from a teenager in the Chesapeake House, a gay bar located at 746 Ninth St. NW, and later performed oral sodomy on the youth at a Northwest apartment. According to the sources, Bauman paid the youth $50.

An employe of the Chesapeake House said yesterday that he had seen a man identified to him as Bauman several times at the downtown club in the past several months.

The FBI learned of the incident several weeks later during an unrelated investigation into child pornography, sources said yesterday. Informants in the case told agents that they had seen Bauman frequenting the gay scene and that he had become involved sexually with the 16 year old.

The investigators questioned the youth, who confirmed the allegations.

FBI agents informed Bauman shortly after Labor Day that he was the subject of a criminal investigation. His attorney subsequently worked out the arrangement with prosecutors.

Bauman's supporters charged yesterday that the investigation was politically motivated to embarrass a prominent Republican who is a strong supporter of Republican presidential candidate Ronald Reagan and a candidate for reelection in the 1st Congressional District. The allegation was denied by U.S. Attorney Charles F. C. Ruff.

"The matter was pursued in a wholly professional manner," said Ruff, "and it was brought to fruition at the normal time in the normal fashion."

Other federal sources familiar with the case concurred saying the investigation was conducted with extreme care. "We don't go looking for this type of thing," said one. "We don't want to go digging into someone's personal life, but when an allegation of involvement into soliciting is laid out in front of us, there's nothing to do but pursue it."

The investigation was handled by the major crimes section of the U.S. attorney's office in the District of Columbia. Senior officials in the Justice Department were informed of the investigation but refrained from becoming involved, according to sources close to the case.

During their summer-long investigation, FBI agents received a number of reports from sources in the gay community that Bauman had been frequenting the gay clubs along Ninth Street NW, making little effort to conceal his identity.

In a statement released to The Washington Post Thursday night, Bauman said that he had "an increasingly serious personal problem with the consumption of alcohol. Last winter my drinking problem reached what I now realize to be the stage of acute alcoholism, although I did not know it at the time."

Bauman said that with the help of his wife, family priest, doctor and Alcoholics Anonymous, "my own alcoholism is now under control and my sobriety restored."

Dr. Albert Dawkins of Easton, a longtime friend of Bauman and his former personal physician, told a Post reporter yesterday that he did not think his friend had ever been an alcoholic.

"I would not consider Bob an alcoholic," Dawkins said. "As a physician, I define an alcholic this way: when the use of alcohol interferes with the person's productive life or his health, his ability to function. There is no evidence I know of in the lifetime I've known Bob Bauman that alcohol interferes with his productivity, his ability to function."