Lev. 22:24 & Deut. 17:1
(Leviticus 22:24) - "Also anything with its testicles bruised or crushed or torn or cut, you shall not offer to the Lord, or sacrifice in your land."
(Deuteronomy 17:1) - "You shall not sacrifice to the Lord your God an ox or a sheep which has a blemish or any defect, for that is a detestable thing to the Lord your God."
The Old Testament is full of animal sacrifices offered by the priests of Israel. These sacrifices were intended to remove the sins of the people and of the nation. But, ultimately the blood of animals could not cleanse anyone from their sins (Heb. 10:4). So, what the Israelites were doing was participating, by faith, in the sacrificial system which was instituted by God in the Garden of Eden when Lord covered Adam and Eve with animals skins--killing an animal and shedding its blood to do this. This sacrificial system was followed throughout the Old Testament as is amply detailed in Leviticus. This shedding of blood was a representation of the future sacrifice of Christ as He shed His blood for the remission of our sins. Jesus was the true sacrifice--the perfect atonement for our sins.
The reason the animal sacrifices had to be without blemish was that they represented, though imperfectly, the Lord Jesus. As Jesus was without blemish, so too, the Old Testament sacrifices had to be without blemish.