In 1996 he was called to work at the Vatican as pro-prefect of the Congregation for Clergy, and two years after was made a cardinal and prefect of the congregation. He remained head of the congregation until 2006.
Castrillón also served as president of the Pontifical Commission Ecclesia Dei from 2000 until his 2009 retirement. The commission is responsible for institutes and communities which use as their proper Rite the extraordinary form of the Roman rite (the Roman Missal of 1962). It is also responsible for discussion with the Society of St. Pius X (SSPX), a priestly fraternity which is in an irregular situation and whose priests do not legitimately exercise their ministry.
While he was president of Ecclesia Dei, he oversaw the regularization of a traditionalist priestly society in Brazil, which became the Apostolic Administration of St. John Vianney, and of the Transalpine Redemporists (the Sons of the Most Holy Redeemer). It was also during his tenure that the excommunications of the SSPX bishops who were illicitly consecrated in 1988 were remitted.
In 2003, Castrillón celebrated the first Pontifical Mass in a Major Basilica since the liturgical reform which followed the Second Vatican Council, at St Mary Major.
He was criticized in 2010 for a letter he had written in 2001, as prefect of the Congregation for Clergy, in which he congratulated a French bishop for not reporting a priest to the authorities for sexual abuse of a minor.
Bishop Pierre Pican, who had received a suspended three-month jail sentence for his failure to report the abuse, had admitted in court that he had kept the priest in parish work even though he had privately admitted to committing acts of abuse.
In the letter, the cardinal wrote that Pican "acted well," and that he was pleased that a fellow bishop "preferred prison to denouncing his son and priest."
Castrillón went on to say that he believed relations between a bishop and his priests were more than professional but had "very special links of spiritual paternity," which therefore did not oblige bishops to testify against their priests.
Castrillón's funeral Mass will take place in St. Peter's Basilica May 19. Cardinal Angelo Sodano, dean of the College of Cardinals, will be the principal celebrant. As customary for the funerals of cardinals, Pope Francis will preside over the final commendation.