They had a spot (still there, obviously) called “the place of rejection”. The high-end citizens would meet there, inspect the baby, and “vote him off the island” if not “perfect”. They just hurled the infant to his death. Members of the two royal houses were by and large not put through this, and none of the girl babies. The goal was to maintain the fitness of the master race which made up the army and ruled the whole area. There were no walled settlements allowed, and no weapons allowed among those under the thumb of Sparta.
The practice of exposing unwanted children was (almost) universal in the classical world. The sole exception, AFAIK, were the Jews. Ancient travel writers would comment on this extremely odd Jewish custom.
The Spartans were thus quite ordinary in their practice of exposing unwanted children. They were unusual only in that this determination was made by the State, not the male head of the household.