Do you have evidence that such cardinals the Pope appoints are actively gay with boyfriends? The Church doesn't condemn homosexuals, it's the homosexual acts that are condemned. If a clergyman engages in such sinful acts, he is violating his vows he made to God, not the Church. They add to the serious nature of the sin in the first place.
"...However, the Church also acknowledges that “[homosexuality’s] psychological genesis remains largely unexplained. . . . The number of men and women who have deep-seated homosexual tendencies is not negligible. This inclination, which is objectively disordered, constitutes for most of them a trial. They must be accepted with respect, compassion, and sensitivity. Every sign of unjust discrimination in their regard should be avoided. These persons are called to fulfill God’s will in their lives and, if they are Christians, to unite to the sacrifice of the Lord’s cross the difficulties that they may encounter from their condition.
“Homosexual persons are called to chastity. By the virtues of self-mastery that teach them inner freedom, at times by the support of disinterested friendship, by prayer and sacramental grace, they can and should gradually and resolutely approach Christian perfection” (CCC 2357– 2359).
Homosexuality