A son's circumcision was the first religious obligation of a father, and with this ceremony (cf. Lk 2:21) Joseph exercised his right and duty with regard to Jesus.
The principle which holds that all the rites of the Old Testament are a shadow of the reality (cf. Heb 9:9f; 10:1) serves to explain why Jesus would accept them. As with all the other rites, circumcision too is "fulfilled" in Jesus. God's covenant with Abraham, of which circumcision was the sign (cf. Gn 17:13), reaches its full effect and perfect realization in Jesus, who is the "yes" of all the ancient promises (cf. 2 Cor 1:20).
Conferral of the Name
At the circumcision Joseph names the child "Jesus." This is the only name in which there is salvation (cf. Acts 4:12). Its significance had been revealed to Joseph at the moment of his "annunciation": "You shall call the child Jesus, for he will save his people from their sins" (cf. Mt 1:21). In conferring the name, Joseph declares his own legal fatherhood over Jesus, and in speaking the name he proclaims the child's mission as Savior.
Excerpts from Saint John Paul II, Apostolic exhortation Redemptoris Custos § 11-121.12