Long before the Reagan administration became concerned about the inequities suffered by working couples under federal tax laws, a Maryland governor named Spiro T. Agnew was on the case.

Thanks to a widely hailed tax reform package championed in 1967 by then-governor Agnew, working couples in Maryland have enjoyed the same rates as single taxpayers on their state income taxes for 14 years.

But that measure, which went into history under the unlikely label of the Agnew-Hughes Tax Bill -- Harry Hughes was then chairman of the Senate Finance Committee and an architect of the bill -- has come to haunt present-day Maryland politicians.

Now that Reagan's federal tax bill has created an extra exemption for working couples, married people who work in Maryland could get a double break on their 1982 state income taxes -- as much as $202.50 per couple in 1982 and up to $315 from then on. It's a sure crowd-pleaser with the married voters, but a killer for the state's budget, which will be strapped already because of the Reagan administration's budget cuts. By 1986, the measure would cost Maryland almost $45 million a year, state tax officials estimate.

So, to keep Maryland financially afloat, state legislators in the 1982 General Assembly session will face the unpleasant task of repealing one of the state's most popular tax breaks or blocking claims on state returns for one of Reagan's most publicized tax exemptions.

Governor Hughes' three top fiscal advisers called this week for emergency legislation in the 1982 session to resolve the problem.

There is, as yet, no rush of legislators to sponsor such a measure, particularly in an election year. Even the fiscal advisers who heartily support the proposal speak gingerly about it.

"If you could somehow forget about politics," said one of them, "and forget that next year is an election year, and forget that a whole group of legislators will be losing their seats because of redistricting, it would be a perfectly healthy and reasonable thing to do."

"If Harry Hughes wants that bill, he may have to come down and introduce it himself," one legislative leader snickered.

But that probably will not be necessary. House Speaker Benjamin L. Cardin (D-Baltimore), who has tried three times before -- in vain -- to get the marriage provision repealed from Maryland tax laws, said he will try again in the 1982 session.

"It's just and it's needed," Cardin said. "You shouldn't be penalized, but you shouldn't be rewarded for having two wage earners, for kicking your spouse out of the house and making her work -- or making him work."

But judging from his past efforts, it will not be easy. A 1978 Cardin bill to repeal the tax break for married couples cleared the House of Delegates, but foundered in the state Senate after a huge lobbying campaign by enraged taxpayers. Women's groups decried the move as an attack on working wives, and several local politicians read it as anti-family, encouraging couples to "live in sin" in order to get the tax advantage.

Under the Hughes-Agnew tax law, working couples in Maryland earning more than $3,000 a year each are allowed to subtract $90 from their total tax bill on their joint returns, which leaves them with the same taxes as two single people with the same incomes. This costs the state $20 million a year, according to income tax officials.

Cardin said studies in 1977 showed the marriage provision was exploited by wealthy taxpayers, who put their wives on their payrolls simply to get a $90 tax rebate. He said the legislature is more likely to nullify the Reagan exemptions than to repeal Maryland's long-time marriage tax rebate. But that proposal already is being denounced by Republicans as an attack on Reaganomics.

"The whole idea of the tax cut is for money to circulate," said State Sen. Howard Denis (R-Montgom- ery). "If we're going to have a break for any class of people, then married couples, where both people are working and in many cases struggling, are certainly worthy." Denis said he will filibuster any move to block the Reagan exemptions in Maryland.

Maryland is not alone in its dilemma. Twelve other states, including Virginia, also had equal rates for married and single taxpayers in the days before the Reagan tax bill. Virginia officials said they will not decide for several weeks how to resolve the problems. "We've been so preoccupied with the federal cutbacks that we frankly haven't gotten too far into the tax bill," one Virginia tax official said.

The Reagan tax bill did not equalize federal tax rates for married and single workers, but it did create an exemption of 5 percent of the income of the "lower-earning spouse" -- up to $1,500 -- in 1982, and 10 percent -- up to $3,000 -- in 1983 and afterwards. Unless the legislature nullifies them, those exemptions will automatically apply to Maryland state taxes, because Maryland adopts federal tax deductions. The same is true for Virginia.

The Reagan exemptions will bite $8.4 million out of 1982 Maryland state and local tax collections and $24.1 million a year once the exemptions are fully phased in, for a total of $44.1 million in lost revenues, Maryland tax officials estimated. They also will give married couples in Maryland a considerable tax advantage over single people, reversing the old inequity.

George H. Spriggs Jr., chief of Maryland's Income Tax Division, recently notified Maryland legislators of the problem, and advised them to introduce a bill to block the Reagan exemptions on state returns if they want to prevent the new inequity.

The renewed discussion about the old Hughes-Agnew bill has amused some politicians and longtime state bureaucrats who see a certain humor in the improbable twinning of Hughes -- known for his spic-and-span honest image -- and Agnew, the first Maryland governor to become a convicted felon. "Aha!" exclaimed one legislative leader during a recent beer-drinking session with his colleagues. "We've finally linked Hughes to Agnew!"

The tax law, in retrospect, has become even more of a footnote to Maryland political history. Not only did it link Hughes and Agnew, but its victory in the House of Delegates in 1967 was attributed in part to the vote-brokering powers of the then-speaker of the House.

His name was Marvin Mandel.