The punishment given to the house of Eli is the result of their wickedness and also an example of the imperfection of the sacrifices of bulls and goats. The sons of Eli did wicked deeds and Eli failed to restrain them. The LORD told Samuel He would judge the house of Eli. The full story is recorded in chapter 2 & 3 of the book of 1 Samuel. I can imagine how helpless Eli felt when he heard the message – more like a sentence or verdict – from Samuel especially the line “the iniquity of Eli’s house shall not be atoned for by sacrifice or offering forever” [1 Samuel 3:14].
Matthew Henry wrote in his commentary that this showed that there were sins that the legal sacrifices could not remove, unlike the blood of Christ that cleansed all our sins. Indeed, despite the strict requirements imposed on the bulls and goats used as sacrifices, eg they must be without blemish, these animals were still imperfect. When Jesus died on the cross, He offered Himself as the perfect sacrifice and atonement for us, removing our sins with His holy blood.
“… he has appeared once for all at the end of the ages to put away sin by the sacrifice of himself” [Hebrews 9:26]