The Reagan administration is being tugged in opposite directions on the question of federal-state relations. No sooner had the president renewed his pledge to seek further shifts from narrow categorical programs to broad, flexible block grants than the Attorney General's Task Force on Violent Crime came in with a recommendation for a new categorical aid program--this one for the construction of prisons.

The way in which the White House handles this recommendation will tell a lot about how serious Ronald Reagan really is about his commitment to transferring authority to the states and localities.

My bet is that he will do what his predecessors have done. He will rise above principle in order to accomplish his own politically attractive goals.

As everyone knows, Reagan has been as stout in his criticism of the arrogance of the all-seeing, all-knowing, all-controlling federal government as anyone in American public life. He has vowed to dismantle the federal bureaucracy and transfer decision-making power to officials closer to the people. At times, he has even suggested that he will turn back revenue-raising power from the federal government to the states and their subdivisions.

When uttered in the safe rhetoric of generalities, all of this is guaranteed to win applause. But now, for the first time in his presidency, Reagan is face to face with a serious test of his own avowed principles.

Crime is an issue that ranks close to inflation in importance to the voters. For more than a decade, the "war on crime" has been a staple of conservative campaign speeches.

Thus, it was both philosophically consistent and politically smart for the Reagan administration to appoint a showcase commission on crime and greet its recommendations with applause.

A difficulty arises, however, because there is relatively little the federal government can do that directly affects the kind of crime people worry about--street muggings and house burglaries. After all the decades of federal "usurpation" that conservatives complain of, police protection is still regarded as a local function.

But since it is politically unacceptable to say that the federal government is a bystander on the crime problem--even if that happens to be true--the Reagan commission did what dozens of its predecessors appointed by liberal presidents have done with the issues of their day. It recommended a new federal aid program.

It said the feds should distribute $2 billion to the states over the next four years for prison construction, and require each state to put up a 25 percent matching contribution--$500 million in all.

The rationale is impeccable. Prison populations are soaring far beyond the capacity of our jails. Riots and abuse of fellow-prisoners make judges and juries reluctant to impose long sentences on those convicted of crimes. The states are financially strapped. The problem is national in scope, because criminals do not respect state lines in choosing where to stage the next holdup or assault.

All true, just as it was true about subways 10 years ago, schools 20 years ago and poorhouses 30 years before that. Which is how we got federal aid to mass transit and education, federal welfare programs and all those other "intrusive" federal programs Reagan would like to abolish.

But the truth is that the program of federal aid to prison construction contradicts every principle of federalism Reagan has talked about from his first speech for Barry Goldwater to his most recent address to the National Conference of State Legislatures.

It is a new categorical grant, imposing a federal priority on the states. It encumbers state funds. It spends deficit federal dollars in some states with healthy budget surpluses. It defies the logic that says state and local officials are the best judges of the needs of their own constituencies.

But judging from the welcome presidential assistant Ed Meese and the Justice Department have given the task force recommendations, none of these problems of logic will prevail over the political desirability of sponsoring an anti-crime program with Reagan's name on it.

Still, it remains a test of his principles. In his first round with Congress, Reagan was able to move $2.3 billion of federal aid from categoricals to block grants. If he now wipes that out by sponsoring a new $2 billion categorical grant program, he puts himself in the same league as Jimmy Carter, who came to Washington pledged to "simplify" the federal government and ended by adding two dubious new Cabinet-level departments.