Two charitable foundations, asserting that the homeless are not simply winos or bag ladies, announced yesterday that they are committing up to $25 million to provide free health care to thousands of homeless people in 18 major cities -- including the District of Columbia.

Representatives of the Robert Wood Johnson Foundation and the Pew Memorial Trust said at a press conference that the money will go to nonprofit organizations in each of the selected cities starting in January. The organizations have pledged to use the funds to establish health clinics, staffed by doctors and nurses, in city shelters and soup kitchens.

"We don't want to get into political questions of who is responsible for the plight of the homeless," said Drew E. Altman, vice president of the Johnson foundation. "All we know is that people are suffering and we have an obligation to help them."

The homeless population now is estimated as high as 3 million, with about 5,000 of them in the District of Columbia and about 15,000 in the metropolitan Washington area.

"These are not simply winos or bag ladies," said Dr. David E. Rogers, president of the Johnson Foundation. "Too often they are families with innocent children starting life on the wrong foot. Some of them are even college educated."

The Health Care for the Homeless Program will serve between 1,500 and 10,000 people in each city, officials said. Cities selected to receive funding, besides the District, include Albuquerque; Baltimore; Birmingham; Boston; Chicago; Cleveland; Denver; Detroit; Los Angeles; Milwaukee; Nashville; New York City; Philadelphia; Phoenix; San Antonio; San Francisco; and Seattle.

District officials expect to receive about $300,000 in foundation money during 1985, the first year of the city's four-year $1.3 million grant, according to coordinator Patricia N. Mathews of the Community Foundation of Greater Washington. Mathews said the money will be used to establish a health care unit in four of the District's 23 shelters and to have a medical team make visits to the city's 12 soup kitchens and six drop-in centers.

Shelters scheduled to get health centers, Mathews said, are Blair Shelter, 611 I St. NW; House of Ruth, 651 10th St. NE; Federal City College, 425 Fifth St. NW, and either the Bethany Day Center, 1335 N St. NW, or Rachel's Day Center, 1006 M St. NW.

"We plan to start providing medical care in late January or early February," Mathews said.

She said that local officials "obviously are concerned about dumping -- about having a homeless person advised to come to the District because they can be treated here and they can't be treated in the area where they are." But no one will be turned away, she said.

In his remarks, Rogers said that the $25 million contribution is only a "trickle" but that it can "keep homeless people on the national agenda" and start programs that can grow into models for other areas.

Milwaukee Mayor Henry W. Maier, representing the U.S. Conference of Mayors, a cosponsor of the program, said that local government doesn't have the resources for such undertakings. "The local tax is a property tax, and it was never intended to take on social overhead problems," he said. "The local tax was meant to finance roads and bridges and garbage pick-up."

Federal income tax, however, Maier said, "is the richest tax in the world and ought to provide funds for social overhead programs."