I know of a Catholic man who agreed to be the godfather of a child baptized in a mainline Protestant church. He attended the baptism in the church and went through whatever ceremony is used in their tradition. Is this allowed?
Code of Canon Law (CIC) describes the role of a godparent (sponsor) as one “who assists an adult in Christian initiation or together with the parents presents an infant for baptism. A sponsor also helps the baptized person to lead a Christian life in keeping with baptism and to fulfill faithfully the obligations inherent in it” (CIC 872). “Christian” here implies the fullness of the faith – Catholic.
Therefore, a godparent is required to be a confirmed Catholic “who leads a life of faith in keeping with the function to be taken on” (CIC 874 §1.3). Non-Catholics are thus prohibited from functioning in this capacity for Catholics (cf. CIC 874 §2).
Similarly, if a Catholic were to assume this role for a non-Catholic obvious difficulties could arise so the Church provides direction in The Directory for the Application of Principles and Norms on Ecumenism (98) which states the following:
It is the Catholic understanding that godparents, in a liturgical and canonical sense, should themselves be members of the Church or ecclesial Community in which the baptism is being celebrated. They do not merely undertake a responsibility for the Christian education of the person being baptized (or confirmed) as a relation or friend; they are also there as representatives of a community of faith, standing as guarantees of the candidate’s faith and desire for ecclesial communion.
a) However, based on the common baptism and because of ties of blood or friendship, a baptized person who belongs to another ecclesial Community may be admitted as a witness to the baptism, but only together with a Catholic godparent. A Catholic may do the same for a person being baptized in another ecclesial Community.
b) Because of the close communion between the Catholic Church and the Eastern Orthodox Churches, it is permissible for a just cause for an Eastern faithful to act as godparent; together with a Catholic godparent, at the baptism of a Catholic infant or adult, so long as there is provision for the Catholic education of the person being baptized, and it is clear that the godparent is a suitable one.
A Catholic is not forbidden to stand as godparent in an Eastern Orthodox Church, if he/she is so invited. In this case, the duty of providing for the Christian education binds in the first place the godparent who belongs to the Church in which the child is baptized.