The U.S. Supreme Court ruled yesterday that the federal government can force states to pay back federal grant money it claims the states misspent, in a decision with potentially costly consequences for Maryland and Virginia.

The court ruled unanimously in Bell v. New Jersey et al. that the secretary of education has the authority to recoup $1.4 million in federal funds given to New Jersey and Pennsylvania in the early 1970s under Title 1. The largest federal grant program for elementary and secondary schoolchildren, Title 1 began in 1965 as one of the reforms of the Great Society and was designed to aid disadvantaged children in low-income areas.

Government attorneys said the opinion, delivered by Justice Sandra Day O'Connor, will give the federal government added leverage in its attempts to collect funds it says were misspent in grant programs administered by a variety of federal agencies.

The decision enables the federal Department of Education to go ahead with attempts to collect more than $60 million from 25 states, including Maryland and Virginia, that have been cited for Title 1 violations prior to 1978.

Maryland has been asked to pay back $11 million, one of the highest sums in the nation, for alleged violations in the Baltimore city school district between 1974 and 1978. Virginia, cited for violations between 1977 and 1979, could lose $3.3 million.

Although yesterday's ruling is a blow to state governments, it does not necessarily mean that Maryland and Virginia will have to refund the money that the federal government is seeking. The high court only addressed the secretary of education's power to collect funds in cases where the government has been able to verify the violations during a review by the education department's appeals board or in court.

Officials in Maryland and Virginia are still challenging the government's claims in front of the education appeals board. Both states dispute federal auditors' reports that some of their Title 1 money was spent on ineligible children and for programs not allowed under the Title 1 guidelines.

Maryland Attorney General Stephen H. Sachs and other state officials, challenging the federal government, have said that all of the state's money was spent on poor schoolchildren, as the progam intended. These officials said confusion in spending procedures arose only when complex new Title 1 guidelines were written in the mid-1970s.

In a brief filed before yesterday's ruling, the states argued that the Title 1 statute does not give the secretary the authority to reclaim money from states, and that such authority would be more "broad and intrusive" than he is entitled to.

Justice O'Connor disagreed, however, and wrote that the statute clearly states the federal government's "right" to claim funds misspent by states.

If the education appeals board and a court determine that Maryland and Virginia must repay Title 1 money, the states could seek yet another recourse. Under a 1978 statute, states that are forced to repay funds can ask the secretary of education to recycle as much as 75 percent of the money back to them. The secretary may decide to "grant back" the funds if the states have come into compliance with the program and if they present a specific plan for using the money properly.

Yesterday's ruling did not pertain to funds misspent after 1978, because in that year Congress empowered the secretary to reclaim federal money spent improperly, although the procedure for recoupment was limited again somewhat in 1981.

The court's ruling was an ironic victory for the Reagan administration that, in the past, has endorsed the view that states should be able to allocate federal funds as they see fit.

In addition to New Jersey, which must pay $1 million, and Pennsylvania, which owes $422,000, other states that have been cited for violations include West Virginia, Kentucky, California, Texas, Illinois, Mississippi, New Mexico, Nevada, Oklahoma, and Oregon.