The firstborn were important to God: they had a special importance following events in Egypt.
Rather than taking each firstborn from his family, God used the Levites, setting them apart. There were 22,000 Levite males and 22,273 male Israelites at least a month old.
The numbers almost balanced, and that was probably the plan all along:
3:41 The Levites must be reserved for me as substitutes for the firstborn sons of Israel; I am the Lord. And the Levites’ livestock must be reserved for me as substitutes for the firstborn livestock of the whole nation of Israel.