Roy M. Cohn, the flamboyant lawyer who became famous as the communist-hunting counsel for Sen. Joseph R. McCarthy's committee in the 1950s, was disbarred today by the Appellate Division of the state Supreme Court in Manhattan.

The decision, part of a four-year battle between Cohn and the New York legal establishment, upheld a judicial disciplinary panel's charges of "dishonesty, fraud, deceit and misrepresentation."

It went beyond the panel's recommendation in finding that Cohn had entered the Florida hospital room of dying multimillionaire Lewis Rosenstiel, founder of the Schenley Distillers empire, while Rosenstiel, 84, was senile, semicomatose and drugged in December 1975. Rosenstiel died 6 1/2 weeks later.

Cohn held Rosenstiel's hand to sign a document naming Cohn a co-executor of Rosenstiel's will after falsely telling him that the document dealt with his divorce, the court found.

According to the 49-page decision, Cohn refused to repay a $100,000 loan from a client and lied about it in court; violated an escrow order, allowing dissipation of a corporation's assets in a securities-fraud case, and concealed pending disciplinary proceedings on an admission application to the District of Columbia Bar.

"For an attorney practicing for nearly 40 years in this state, such misconduct is inexcusable, notwithstanding an impressive array of character witnesses who testified in mitigation," the court found.

Cohn's attorneys had sought to have the disbarment proceedings halted on grounds that Cohn, 59, is dying. His doctor testified in October that Cohn had a "life-threatening disease" and a life expectancy of two to 12 months. Cohn has described the illness as liver cancer.

Cohn did not return calls today to his New York office or his home in Greenwich, Conn. One of his attorneys, Eugene Gelernter, said no decision had been made on whether to appeal the disbarment.

However, in interviews last year, Cohn called his accusers "left-wingers," "deadbeats" and "a bunch of yo-yos just out to smear me up." The disbarment action, he said, was "a broad ideological question . . . . What McCarthy was accused of practicing is actually being practiced against me."

Cohn's case attracted wide attention not only because of his notoriety -- he has stayed in the news as a lawyer for organized-crime figures and the jet set -- but also because of character witnesses who came to his defense during 27 days of hearings.

Among them were Rep. Mario Biaggi (D-N.Y.), ABC's Barbara Walters, developer Donald Trump, syndicated columnist William F. Buckley Jr. and New York Times columnist William Safire.

A prominent supporter of President Reagan and occasional guest at the White House, Cohn received a get-well telegram from Reagan while in the hospital a few months ago.

Cohn contended that his law firm, not he, handled the escrow account, that the $100,000 loan was an advance on legal fees and that the misconduct charges were not "formal" and therefore need not be reported to the D.C. bar.

In the Rosenstiel case, a Florida judge invalidated the codicil on grounds that Cohn "misrepresented" the document to him.

The New York disciplinary committee declined to add that case to its charges, but the court reinstated it after reviewing evidence, including Rosenstiel's illegible signature, and testimony of doctors and nurses present when Cohn made an unannounced late-night visit to the hospital 6 1/2 weeks before Rosenstiel died.

According to the court, Rosenstiel had suffered a stroke and was partially paralyzed and nearly blind. Cohn had been his attorney in a bitter divorce case but had never dealt with Rosenstiel's will.

However, Cohn flew to Florida while Rosenstiel was on the critical list and, without notifying Rosenstiel's regular attorney or family members, had him sign a document naming as trustees Cohn and a Rosenstiel relative with legal claims against the Rosenstiel estate.

The hospital attendant on duty that night testified that Rosenstiel was "almost comatose" and that Cohn had "tried to take Rosenstiel's hand for him to sign" the document.

When Rosenstiel was unable to move, Cohn returned the following morning, the court said. The nurse on duty testified that she heard Cohn describe the document as "tak ing care" of his divorce and telling Rosenstiel, "We will help you, Lew, to sign."

The court concluded that Cohn's behavior was "highly unethical" and that his testimony on the events was "untruthful, misleading and evidence of highly unprofessional conduct."