President Reagan said today that the decline in American education is directly related to 20 years of court orders requiring schools to take the lead in correcting "long-standing injustices in our society: racial segregation, sex discrimination, lack of opportunity for the handicapped."

Reagan addressed the National Association of Student Councils here after visiting Louisville, where the Kentucky Commission on Human Rights had asked him to speak about Louisville's successful and trouble-free busing program. However, the White House turned down the request, and Reagan did not mention the city's busing efforts in a speech to the National Vocational Industrial Clubs of America.

Reagan's two speeches to student groups are the latest in a series on education that he began shortly after a presidential commission reported that American schools were being "eroded by a rising tide of mediocrity."

The president did not comment on today's Supreme Court decision upholding tuition tax credits in Minnesota, an idea he has often endorsed.

Instead, his address here focused on court mandates as a "major factor" in the decline of American schools. The president said:

"About 20 years ago, Congress passed the first large-scale aid to public schools... As some of us had warned, with federal aid came federal control... Over the same period, the schools were charged by the federal courts with leading in the correction of long-standing injustices in our society: racial segregation, sex discrimination, lack of opportunities for the handicapped.

"Perhaps there was simply too much to do in too little time, even for the most dedicated teachers and administrators. But there is no question that somewhere along the line many schools lost sight of their main purpose. Giving our students the quality teaching they need and deserve took a back seat to other objectives."

Remarking that Theodore Roosevelt called the presidency a "bully pulpit," Reagan said he is using the pulpit because he wants to make education one of the "most important initiatives of this administration."

"I sometimes wonder what future historians will think looking back on our era," the president said. "We live in a time where rapid, startling advances are being made in science, where men and women are traveling in space... How will posterity reconcile these facts with clear evidence that too many of our schools are teaching less? I find it puzzling myself...."

In Louisville, the president told 6,500 students and teachers in the Vocational Industrial Clubs of America that they "will shape, fit, mold, construct and program a new century for America." "That's why our drive for excellence in education must reach every student in every school in every subject," he said. "We should see that all our young people get a good grounding in English and literature, history, math, science and the other basics. But we must also recognize that our vocational classrooms are just as important as any other."