Problem: God had commanded Moses that “all the firstborn of man among your sons you shall redeem” (Ex. 13:13; cf. 22:29). However, this was never done. Instead, one whole tribe was set apart to God for the work of the priesthood (Num. 3:12).
Solution: The reason for the substitution is given in Numbers 3:12. The Lord declared: “I Myself have taken the Levites from among the children of Israel instead of every firstborn who opens the womb among the children of Israel.” Since they belonged to Him, God had the right to make the substitution.