The leadership of the Maryland Senate unofficially changed hands today but not without a good deal of open hostility between some rural and urban legislators, and several verbal swipes at the Democrat chosen to be the new Senate president, Baltimore County Sen. Melvin A. Steinberg.

Only Steinberg's name was put in nomination when the 41-member Democratic Caucus met in the red-carpeted Senate chamber this morning, but the supporters of deposed President James Clark Jr., many from the state's rural areas, dashed Steinberg's hopes for a smooth transition.

Within seconds of the caucus choosing Steinberg, supporters of Clark were on their feet, decrying the treatment of Clark by Steinberg's supporters and warning that the new president would face a divided Senate when he takes command.

The scene in the Senate contrasted with the goings on across the marble hallway in the state capitol where Democratic members of the House of Delegates were also making their leadership choices.

The only speech on the House side was made by Speaker Benjamin L. Cardin whose renomination as Speaker was assured. Cardin, poised to run for governor in four years, used his acceptance speech to denounce the Reagan administration, saying, "Our problems today are coming from Washington . . . the national economy is in a shambles."

Cardin made news when his rhetorical barrage was over, announcing that bills involving labor would be assigned this session to the Constitutional and Administrative Law Committee rather than Appropriations, where Del. R. Clayton Mitchell Jr. (D-Kent), a staunch foe of labor, is expected to be named chairman. Cardin also announced that Public Service Committee bills would be moved to the CAL committee from Environmental Matters, where Del. Larry Young (D-Baltimore), not popular with the utility lobby, is expected to be named chairman.

Steinberg and Cardin will officially be elected on Jan. 12, the first day of the session. The caucus votes today were decisive since Democrats outnumber Republicans in the General Assmembly by 165 to 23.

As usual, the goings on in the House of Delegates were tame compared to the raucous Senate.

The most outraged senator was Frederic C. Malkus Jr. (D-Dorchester), the conservative from the Eastern Shore who, under Steinberg, will lose his job as vice chairman of the economic affairs committee.

"After 32 years in the Senate of Maryland and in my last four-year term I was hopeful that I would not be embarrassed this way," Malkus said angrily, poking his finger at Steinberg who sat one seat away, his hand slumped against his chin.

Several weeks ago, after learning Steinberg planned to strip him of his vice-chairmanship, Malkus wrote an angry letter to Steinberg that according to several people who have seen the letter said, "You are doing to the rural senators in the Maryland Senate what you did to the Palestinians in Lebanon." Steinberg is Jewish.