In one of their nimblest political moves of the year, House Republicans last week attached a big anticrime bill to the spending resolution the government needs to keep operating this week, and in the process created a sharp campaign issue against some vote-switching Democrats in the November election.

The legislation, an administration favorite, was approved by the Senate earlier this year, 91 to 1. Parts of it had also been approved by the House, but it was clear most of the provisions would die in the House Judiciary Committee as Congress rushed toward its scheduled adjournment this Friday.

Until last week, Republicans had assumed that the anticrime bill would die with the 98th Congress, but that a campaign issue would rise from its ashes as they accused Democrats of being soft on crime. They perhaps have lost the edge on that issue, but said last week that they now have new ammunition to attack individual Democrats for voting on both sides of the issue within hours.

Ironically, much of the impetus for the ploy came not from the Young Turk Republicans who have been harassing the Democrats all year, but from House Minority Leader Robert H. Michel of Illinois, a normally accommodative veteran respected on both sides of the aisle.

The drama began in the early afternoon last Tuesday when the Republicans requested a procedural vote to allow the crime bill to be attached to the crucial spending bill. That effort was rejected, with only 25 Democrats voting with the Republicans. The Republicans thought that this gave them an issue for the campaign.

Five hours later, after behind-the-scenes maneuvering by Michel, Rep. Daniel E. Lungren (R-Calif.) introduced a motion to reconsider the spending bill and to attach the crime legislation.

Lungren said: "We have had a lot of rhetoric. We have talked a lot about this issue. The American people are demanding that we have an opportunity to vote on it. This is your chance . . . . You cannot dodge it; this is your chance to do it."

Faced with an up-or-down vote on the crime bill, the House voted 243 to 166 to include the bill, with 59 Democrats changing their votes.

Some Republicans had not wanted the second vote, preferring not to let any Democrats off the anticrime hook. But Michel persisted and prevailed.

Rep. Newt Gingrich (R-Ga.) said he believes that Republicans will be able to exploit both the Democratic resistance and in some cases Democratic turnarounds on the crime bill to double the number of House seats gained by the Republicans in the elections.

"At 12:58 p.m., when they thought they had a procedural figleaf, they voted to kill it," Gingrich said. "When we got them out in the open, they had to vote for it because they were scared of the vote. They're more scared of the voters now.

"It is not a bad issue if you take the willingness of the congressman to kill a bill while telling you he is for it and doing flip-flops in five hours both ways," Gingrich said. "If your candidate can sit there and look in the camera and say: 'This guy not only voted against your values, he then tried to deceive you . . . , 'I think there are a lot of marginal Democrats who are in real trouble."

What now will happen to the crime bill is not clear. As the Senate continued last week to struggle with the spending bill, adding new provisions, a Senate leadership aide said Reagan is willing to allow the crime bill to die to get a spending bill that is more acceptable to him. Work continues on the bill this week.

Here are some of the key components of the crime package:

*Bail. Judges would be allowed to consider whether the defendant poses a danger to the community in deciding whether to release him before trial. Existing law requires that the defendant be released on bail if there is reason to believe he will appear for trial. Penalties for bail violation would be increased from a maximum of five years in prison and a $5,000 fine to 10 years in prison and a $25,000 fine.

*Sentencing. The legislation creates a grading system for crimes, ranking them according to seriousness. It establishes an independent commission to set sentencing guidelines, and specifies that an individual can be sentenced to probation, a fine, a prison term or a combination thereof.

*Forfeiture. Government authority to require forfeiture of profits and proceeds of organized crime and drug-trafficking operations would be increased, and the bill would allow the government to go after other assets if the actual proceeds of the crime had been removed.

*Insanity defense. The insanity defense would be limited to those defendants who are unable to understand the nature and wrongfulness of their acts because of a severe mental disease or defect. It shifts the burden of proof from the prosecutor, who now must prove beyond a reasonable doubt that the defendant is not insane, to the defendant, who would have to prove his insanity.

In addition, a person found not guilty by reason of insanity would be required to be committed to a mental hospital until a court determines he is no longer a danger to other people. There is now no federal commitment procedure.

*Drug penalties. The legislation increases penalties for drug-trafficking and gauges the penalties to the quantity of drugs involved. The current maximum penalty of 15 years in prison and a $25,000 fine would be increased to 20 years in prison and a $250,000 fine.

*Labor-racketeering. Violation of the Taft-Hartley Act involving labor bribery or payoffs of more than $1,000 would be raised from a misdemeanor to a felony with penalties increased from a year in prison and a $10,000 fine to five years in prison and a $15,000 fine. In addition, the bill would increase from five years to 10 years the amount of time a union official convicted of corruption can be prohibited from holding official union or trust fund positions.

*Currency transactions. This provision, aimed at large-scale drug trafficking and organized crime operations, would increase the penalties for violating the reporting and record-keeping requirements for carrying large amounts of cash into or out of the country. It would authorize customs officers to search -- without a warrant -- any person, vehicle, boat or plane entering or leaving the country if the officer suspects a violation of currency laws.

The legislation also creates a reward system of 25 percent, to a maximum of $150,000, for anyone who provides information that leads to the recovery of more than $50,000 through a penalty, fine or forfeiture.

*Violent crime. Contract murders would become federal crimes when interstate commerce is involved. Violent crimes such as murder, kidnaping and assaults would become federal crimes if they were committed to assist racketeering activities.

The bill would set a minimum sentence of five years for the use of a firearm in the commission of federal crimes, in addition to the sentence for the underlying crime.

*Nonviolent crime. Federal laws against production and distribution of pornographic materials involving children would be strengthened, and the maximum age of the children protected would be raised from 16 to 18.