The scripture described Joseph as a righteous man, his righteousness made him to cover his wife’s “shame”. You can imagine what could have happened to Mary if the husband had exposed her to the public, before he would discover that she did not engage herself in any disgraceful act with another man.
What these so called spouses fail to understand is that when they are bent on disgracing their spouses, they will also have a share of the disgrace. The scripture says we should carry each others cross… (Galatians 6:2).
Nothing should make you to expose your spouse to any public disgrace, the bible says "therefore shall a man leave his father and mother and is united to his wife, and they will become one flesh" (Genesis 2:24).
Subjecting your spouse to public disgrace is not the solution to any problem, it is better to calm down and listen to what God have to say about the issue like Joseph did.
If you disgrace your spouse by exposing his/her weakness/ secrets, you will share in the consequences. Problems, weakness/secrets should be dealt with in the family without exposing it to the public.