Legal frameworks such as zoning regulations and land use policies are essential for protecting open spaces in urban environments by designating areas for conservation, restricting development, and ensuring the preservation of green infrastructure for future generations.