The Senate voted 97 to 0 yesterday to confirm appeals court Judge Anthony M. Kennedy to the Supreme Court, formally ending a bitter struggle over the Reagan administration's attempt to change the direction of the high court.

Kennedy, 51, a moderate, nonideological conservative who is now a court of appeals judge in California, will be sworn in Feb. 18 as the nation's 104th justice. He will take a seat vacated last June by centrist Justice Lewis F. Powell Jr., and, like Powell, he is likely to cast a deciding vote in cases involving civil rights and civil liberties, abortion and church-state issues.

In an ironic twist that symbolized the perceived difference between Judge Kennedy and President Reagan's first nominee for the seat, controversial appeals court Judge Robert H. Bork, Sen. Edward M. Kennedy (D-Mass.) shepherded the nomination through an hour of perfunctory floor debate.

Sen. Kennedy, one of the leaders of the successful fight against Bork, praised Judge Kennedy's "integrity, intelligence, courage and craftsmanship -- and a judicial philosophy that places him within the mainstream of constitutional interpretation."

Other liberal Democrats, while expressing reservations about some of Kennedy's civil rights rulings, also praised the 12-year appeals court veteran, as did conservative Sen. Strom Thurmond (R-S.C.) who called him "a man of intellect, openness and fairness."

Senate Judiciary Commitee Chairman Joseph R. Biden Jr. (D-Del.) was ill yesterday and did not vote. Two other senators, Albert Gore Jr., (D-Tenn.) and Paul Simon,(D-Ill.) who were campaigning for president, also did not vote.

Kennedy, who has granted no interviews and made virtually no public statements since he was nominated to the court, was typically low-key yesterday. In a statement from Sacramento, he said: "I have a deep appreciation for the honor conferred by the Senate's vote this morning. I can conceive of no greater honor for an attorney or a judge than to devote a career to preserving our constitutional heritage."

Reagan said he was "extremely pleased" that the Senate "has not only restored to the nation a full nine-member Supreme Court; it has reaffirmed this country's commitment to the philosophy of judicial restraint."

Reagan's initial selection of Bork was seen as a bid to change the direction of the high court for years to come and to implement the administration's social agenda. It touched off a titanic battle, with opposition led by civil rights and women's groups.

Bork, a former Yale Law School professor and solicitor general, was perceived as too ideologically rigid and insensitive to free speech and privacy rights and the civil rights of women and minorities. He was defeated by a 58-to-42 vote, the largest margin of defeat in history for a high court nominee.

After the defeat, a combative Reagan vowed to select a nominee "that they {Senate Democrats} will object to as much as they did to this one." Kennedy was a finalist for the seat, but Reagan, at the urging of administration conservatives, nominated Judge Douglas H. Ginsburg, who had served about a year on the federal appeals court here, instead. Ginsburg withdrew after admitting that he had smoked marijuana while on the faculty of Harvard Law School.

In contrast to Bork, Judge Kennedy told the Senate Judiciary Committee last December that he found a right to privacy in the Constitution where Bork could find none, and that he had no ideological agenda but took each case one-at-a-time, much like his predecessor, Powell.

Kennedy has already missed more than half the 1987-88 court term. He will be sent the briefs in cases scheduled to be heard at the next argument session, beginning Feb. 22. Technically, he could listen to tapes of cases already argued this term but not yet decided, but no justice in recent memory has done that.

Still, the justices have a stack of briefs waiting for him. They could include cases the court has decided to hear but has held up until a full court could consider them, or cases in which Kennedy's vote would be the deciding one in choosing to review a case.

Those pending appeals, some sitting at the high court without action since October, include a controversial mandatory drug testing program for Customs Service employes, two antipornography cases, a constitutional challenge to the authority of the Government Accounting Office to review federal contracts, and a case asking what campaign reporting requirements may be placed on churches that participate in state referenda.

In addition, the eight justices may have split evenly on some cases and Kennedy may be asked if he wants any of those cases reargued either this term or next. There are only four hours of argument time not filled for this term.

A lifelong Sacramento resident, Kennedy was a state legislative lobbyist and lawyer before he was appointed to the appeals court in 1975 by President Gerald R. Ford. Kennedy, like Justices William H. Rehnquist and Sandra Day O'Connor, is a Stanford University graduate. He attended Harvard Law School, alma mater of three other sitting justices, William J. Brennan Jr., Harry A. Blackmun and Antonin Scalia.