Says the doctrine of the Church.
Canon law:
Can. 983 §1. The sacramental seal is inviolable; therefore it is absolutely forbidden for a confessor to betray in any way a penitent in words or in any manner and for any reason.
“In any way” includes requiring that the penitent reveal their sins to another person, even their spouse.
As I said earlier, respected spiritual masters like Fr Dubay talk about getting to a place where spouses want to freely discuss their sins, but, that is not a commandment and not everyone is at that point in their spiritual growth. That sort of exchange requires spiritual maturity.