Its passage follows weeks of intense negotiations as lawmakers from both parties sought to address housing affordability in an election year