Two years ago, New Mexico legislators found themselves with so much surplus revenue that they gave the voters a huge tax cut. This year they had to take most of it back, voting hefty tax increases on income, sales, business, insurance, liquor and oil and gas production.

"People want a quality education system and other services that government provides," said Democrat Max Coll, chairman of the House Taxation Committee, who helped avert the state's first budget deficit in 20 years.

New Mexico's tax increases have been far from unique, according to figures compiled by the National Conference of State Legislatures. Since late last year, 17 states have raised their income and sales taxes, and 14 other states have raised less controversial taxes, such as levies on liquor and gasoline. Another 14 states are expected to raise some taxes later this year.

This would bring to 45 the number of states that are raising taxes this legislative season, further evidence that the tax-cutting days of Proposition 13, which California approved in 1978, are gone.

"State taxes are rising more widely in 1983 than in more than a decade," said conference president William Passannante, speaker pro tem of the New York Assembly. He and other state officials blamed this on declining federal aid and the recession's depressing effect on state revenues.

Minnesota, New Jersey, Indiana, Mississippi and Nebraska raised their income taxes late last year. They were joined in recent months by New Mexico, Michigan, Rhode Island, West Virginia and Ohio.

In Ohio, newly elected Democratic Gov. Richard F. Celeste pushed a $500 million package of tax increases and spending cuts through his Democratic legislature in a matter of weeks, turning a 50 percent income tax surcharge into a 90 percent permanent surcharge. Although the state is required to balance its budget, most Republican legislators opposed the tax increase.

"The Republicans wanted to hang the tax bill on us," said Paul Costello, Celeste's press secretary. "The game in this state has been temporary tax after temporary tax, and everyone knows it is just a sham."

New Mexico, which gets half of every dollar it spends from oil production revenues, was facing a $60 million deficit because of the drop in oil prices. But it had little room to maneuver because towns in the state do not levy school property taxes and three-quarters of the state's $1.2 billion budget is dedicated to education.

"You can cut all the rest of government and it wouldn't make any difference," House Taxation Committee chairman Coll said.

Rather than reduce spending on education, Coll's colleagues restored about 60 percent of the taxes they had cut in 1981. They also gave cities and counties the option of increasing the sales tax after local leaders complained of declining services.

Several states, led by New Mexico and its 20 percent corporate tax increase, have increased business taxes. New York imposed a 10 percent capital gains tax on major real estate transactions and a 2 percent gross receipts tax on oil companies. Rhode Island increased corporate taxes from 8 to 9 percent, while Alabama raised its oil and gas taxes.

More business taxes seem certain in the coming months. Ohio's Celeste, for example, has proposed a 4 percent tax increase on purchasers of professional services ranging from legal help to architectural work.

Other states have raised a variety of minor taxes. Seven states raised gasoline taxes, four raised cigarette taxes and three raised liquor taxes. Colorado, Maine and Wisconsin canceled scheduled tax reductions, while Arizona, Kansas and California speeded up tax collections