BTM as long as she is on the title you cannot change the locks on her. So do not do that. You can ask for the keys in a polite way. But if she keeps them she keeps them.
Thats the law here.
But a good boundary to set in place is that she asks permission to come over and gives the reason why. If you say no. Then she cannot come over.
Never say never.
If he pursues a legal separation agreement (which might not be a bad idea, it can stop any debt she accumulates during waywardness from becoming his debt), he can easily provision that she will not access his home without his consent, regardless if the title is under both names, he can set it up so that she can't access his home without his permission. She may be entitled to half of the home's value but he is entitled to his privacy. He can also stipulate in the agreement that if the mortgage on the home is under both names, he can still legally require her to pay whatever is required - if she is listed as a co-borrower on the mortgage, the responsibility still exists regardless if she lives there or not. You know if he was to lose his job and couldn't make any payments on that mortgage, the bank would be looking for her to do what she can, she is employed.
As for the original inquiry, when spouses legally separate they can live separately without worrying that the other spouse is going to pop in unannounced.