The authorities had said the plan was necessary to save money, but crowds of health workers demonstrated monthly last year, saying the privatizations would harm healthcare and make it more expensive for users.
"We have decided to drop this project," the president of the Madrid government, Ignacio González, told a news conference on Monday, adding that regional health minister Javier Fernandez-Lasquetty had resigned.
The announcement came after González's conservative administration lost an appeal to the regional high court against an earlier judgment that ordered the plan to be suspended.
The court said in a ruling that legal uncertainties over the privatization process raised the risk of "damage" to the regional health system "that would be difficult or impossible to repair," according to a written summary.
Tax-funded public healthcare is provided free of charge to registered users in Spain.
The Madrid hospital plan was part of a nationwide drive to save billions of euros on public services such as health, which is managed by the powerful regional authorities.
"We continue to think that this is a legal and viable management model," Gonzalez said of the privatization plan.
The budget cuts were imposed by the central government in 2012 in its bid to fix the public finances as concern for Spain's stability rattled the euro zone.