The House yesterday passed a bill providing for a $425 million program to boost science and mathematics education nationwide, rejecting Reagan administration protests that the cost is too high in a year of astronomical budget deficits. The vote was 348 to 54.

All sides agreed that the program, which still must clear the Senate, is only the first step in dealing with a shortage of science and math teachers and a steady decline in the numbers of their students.

A bipartisan parade of House floor speakers summarized the problem: 43 states have a shortage of qualified math teachers; 25 percent of science and math teachers plan to leave the field soon, many for better-paying jobs in industry; two-thirds of all high schools require only one year of science and math; 69 percent of all science teachers have never had a course in computers; Japan, its population only half that of the United States, graduated an equal number of engineers last year.

"We're eating our seed corn," harming long-range U.S. research and security interests, said Rep. Don Fuqua (D-Fla.), chairman of the Science and Technology Committee that pushed part of the bill.

The plan would set aside $250 million for grants to help state and local school districts update teacher skills, retrain teachers of other subjects and buy new equipment, including computers.

An additional $20 million would fund up to 5,000 full one-year scholarships next year and 10,000 in 1985 for college students who promise to go into science and math teaching, although $7 million could be used to make science teachers out of retired military personnel, college graduates or teachers in other fields. That was the sole remnant of President Reagan's original proposal, which consisted solely of a $50 million program for retraining.

Rep. E. Thomas Coleman (R-Mo.) offered an amendment to make the entire $20 million available for retraining rather than for college scholarships. "There would be 4,000 new teachers in the classroom teaching math and science within 12 months," he said.

But Rep. Carl D. Perkins (D-Ky.), chairman of the Education and Labor Committee, which sponsored the bill, said adequate retraining takes much longer than one year.

"This just would not work," he said. Coleman's amendment died, 276 to 138.

The bill would also provide summer institutes for teachers and more research in math, science and foreign-language education, while minority institutions would continue to receive a special $5 million grant.

The measure would allot $100 million for matching grants through the National Science Foundation for recruiting, training and holding engineers in teaching, developing new materials for teaching science and math and providing more scientific equipment.

The House turned back, 323 to 92, an amendment by Rep. F. James Sensenbrenner Jr. (R-Wis.) that would have given the scholarship money to the states to spend, if they liked, on better pay for science and math teachers. The National Education Association, the nation's largest teacher union, opposes the idea as discriminatory, and Perkins said the amendment "doesn't amount to a hill of beans" in tackling the problem of teacher shortages.