The first and best answer to this question is: because Jesus said so!
In St. John’s Gospel, Jesus appeared to His Apostles after His Resurrection and said to them:
“Peace be with you. As the Father has sent me, even so I send you.” And when he had said this, he breathed on them, and said to them, “Receive the Holy Spirit. If you forgive the sins of any, they are forgiven; if you retain the sins of any, they are retained.”
Christ clearly states in this passage that He wishes to act through the Apostles in order to forgive men their sins. Since the Church is founded on Peter and the Apostles, the powers given to them are communicated to their successors.
Why might Jesus have chosen to effect the forgiveness of sins in this way?
One reason is so we never have to worry about whether our sins are forgiven. God has given us a simple formula—Confession—for getting back into His graces when we have failed. It’s not based on subjective feeling, but a sacred rite. Within Confession, our contrition doesn’t even have to be perfect, although perfect contrition is the ideal. “Perfect contrition” is being sorry for a sin because it offended God. “Imperfect contrition” is sorrow for sin due to a natural fear of punishment.
Imperfect contrition is all that is necessary within the Sacrament of Confession. God does the rest.
Wow, what a gift. A way to confess and do penance without all the worry of “Have I done it right?”
Other reasons include the sacramental graces we receive in Confession and the advice of the priest, both of which assist us in avoiding sin and growing in virtue.
Jesus is Wisdom Itself. He is the Word of God. He never did anything that was unnecessary—sacramental confession included. He knows us far better than we know ourselves, and knows just what we need.