The Maryland General Assembly met for three hours today at a cost to taxpayers of close to $10,000 to pass a solitary piece of legislation--a corporate anti-takeover bill that many legislators readily admitted was not worth the time or expense.

The complicated legislation, which passed by overwhelming margins in both houses, was designed to make more difficult the sort of hostile takeover effort that was attempted last year by the Bendix Corp. against Bethesda-based Martin Marietta. The measure was so complex and was adopted and signed into law with such dispatch today that legislative leaders agreed to form a special task force to examine the bill and its effects.

Gov. Harry Hughes vetoed a similar measure passed during the legislature's regular 90-day winter session. Business executives, including the head of Maryland-chartered American Motors Corp., said the first bill was so poorly drafted that it would have restricted many normal business transactions and could have forced them to leave the state.

Hughes, who has been trying to overcome a lingering impression that Maryland is anti-business, declared the situation enough of an emergency to warrant a special session, only the second since he became governor in 1979.

Last summer, during the heat of his reelection effort, Hughes called a special session to set up a new program of state-funded additional unemployment benefits program to offset federal unemployment cuts. Today, many legislators said that while last year's one-day session was worth the expense, this year's was not.

"This is a bill of rights for corporate executives who are afraid of losing jobs in a corporate takeover," said Senate Minority Whip Howard A. Denis (R-Montgomery). "There's nothing so special about this special session. This is a political bill that everyone knows isn't necessary and could wait till a regular session."

Denis, despite his criticism, was willing to take advantage of the time to introduce one of his pet projects, a bill on criminal sentencing, that was immediately consigned by Senate President Melvin A. Steinberg to the Rules Committee, which had no intention of meeting before the session ended this afternoon.

Hughes, who met with Steinberg and House Speaker Benjamin L. Cardin 15 minutes after the session ended to sign the bill into law, said Denis' criticism was "politically motivated. This is a good bill."

Maryland's corporate takeover law was stuck down by a federal court judge last year during the Bendix-Marietta fight, which Marietta eventually won. In response to that action Cardin introduced a new takeover bill, which was written for him by corporate lawyers in Baltimore.

The bill sailed through the legislature in March with little debate. Many legislators acknowledged later that they never read it. But after that session, industry representatives said they had read the bill closely, discovered that it was too restrictive and asked Hughes to veto it.

They said that provisions in the law requiring a "supermajority" (80 percent) of stockholders to approve any major transfer of assets was written so broadly that it would have covered not only stock but many other assets, such as a fleet of cars. In addition, representatives of mutual funds said the bill would have restricted them.

The new bill, rewritten by the same corporate lawyers, gives corporations the right to be exempted from the law and specifically excludes mutual funds.

The final vote on the bill was 119-13 in the House where no debate occurred and 37-8 in the Senate. Most of the votes against the bill came from the tiny Republican minority, which stuck together in a rare display of partisanship against the Democratic governor.

The Democrats had their share of partisanship in other matters: U.S. Sen. Paul S. Sarbanes showed up to, among other items, work both chambers searching for support for his presidential candidate, former vice president Walter F. Mondale. And Baltimore County Executive Donald B. Hutchinson collected volunteers for another Democratic contender, U.S. Sen. John Glenn (D-Ohio).