All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
If a Muslim is entrusted with a secret, it is impermissible for him to disclose it to anyone, be it his wife or any other person. The fact that the wife is trustworthy and would not disclose the secret is irrelevant in this regard because imparting the secret to her in this case is considered a breach of trust, which is one of the attributes of the hypocrites. Abu Hurayrah narrated that the Prophet, sallallaahu ‘alayhi wa sallam, said: "The signs of a hypocrite are three: (1) whenever he speaks, he tells a lie, (2) whenever he promises, he breaks his promise, (3) and whenever he is entrusted, he betrays the trust." [Al-Bukhari and Muslim]
Al-Hasan Al-Basri said, "Disclosing the secret of your brother (to others) is considered an act of betrayal."
On the other hand, it is impermissible for a person to tell others about his past sins; instead, he should turn to Allaah in repentance and conceal them. This applies to the spouses with greater reason since this may be a means with which Satan would sow the seeds of discord between them. Jaabir reported that the Prophet said: "Iblees (Satan) places his throne upon water; he then sends detachments (for creating dissension); the nearer to him in rank are those who are most notorious in creating dissension. One of them comes and says, 'I did so and so,' and he says, 'You have done nothing.' Then, one amongst them comes and says, 'I did not leave so and so until I separated between him and his wife.' Satan brings him closer and says, 'Yes! You have done well." [Muslim]
For more benefit, kindly refer to Fataawa 84052, 196083, and 232012.
Allaah Knows best.