The government of Prime Minister Pedro Sánchez, a Socialist, described the measure as critical to Spain’s economic future.