The nation's mayors this week recommended that the federal government build 24 million low-income apartments and homes by the year 2000 and spend $25 billion to salvage thousands of deteriorated public housing units.

A lack of "adequate, safe and sanitary housing" is the biggest problem facing the country, Newport News Mayor Jessie M. Rattley said at a U.S. Conference of Mayors press briefing.

Much of the nation's $65 billion worth of public housing is in jeopardy after years of inadequate upkeep, she said. For example, 350 Newport News families are about to be "put out of their homes" because of termite damage and requirements to remove asbestos and lead-based paint from the aging structures, Rattley said.

The mayors' group is planning to send its spending recommendations and other legislative proposals to Senate housing subcommittee leaders next month.

Sen. Alan Cranston (D-Calif.), head of the subcommittee, has asked city and state government leaders as well as public and private housing organizations to make recommendations for a comprehensive housing authorization bill.

The budget for federal housing assistance has been cut by 75 percent since President Reagan took office, leading to a lack of affordable housing and the growth in the number of homeless Americans, according to Mayor Raymond L. Flynn of Boston.

City governments, business, organized labor, local community development organizations and private nonprofit groups all must provide housing, Flynn said, but "the missing partner in this whole thing is the federal government. They have to come to the table with their money."

Federal funding for maintaining the country's 1.3 million public housing units has been inadequate for years, Chicago Mayor Harold Washington said.

"To let that investment fall down around our feet is ludicrous," he said. Washington said the spending of $25 billion for modernization over a five-year period "is a useful and necessary project."

In addition to rehabilitating housing, 200,000 units a year must be built throughout the country "to keep up with the need," Rattley said.

"The question is, where will our people sleep?"

The mayors also said they will propose establishment of a national housing trust fund as a "permanent renewable source" of money for maintaining existing housing and developing "new, privately owned affordable housing," according to Austin, Tex., Mayor Frank A. Cooksey.

Mayor William J. Althaus of York, Pa., the only Republican on the mayors' housing legislation task force, said "it is wrong to say we can solve the problems by throwing money at them, but it is equally wrong to say" they can be solved by local governments and the private sector alone.

Cranston has said he does not have "high hopes" of enacting housing legislation in 1988, but wants to have a measure "ready for the new president" in 1989.

In the meantime, the current Congress is expected to pass a bill reauthorizing most housing programs at current levels.