Assisting your spouse to avoid punishment

My religious leader told me marriage is a sacred covenant such that a spouse is required to assist their partner even when they discover that the other person has committed a crime. I think this may not align with the law but I am not sure. Please guide me.
NK, Mbeya

We do not know the context of this religious teaching, however, we will provide our answer based on our understanding of your question. Since you talk about discovering a crime, we assume you had nothing to do with the crime and you only later discover that your spouse had committed a crime. Generally, section 387(1) of the Penal Code [Cap. 16 R.E. 2022] provides that a person who receives or assists another who is to his knowledge, guilty of an offence, in order to enable him to escape punishment is an accessory after the fact of the offence. Accessories after the fact can be held liable for an offence to the extent of their role in enabling the offender to escape punishment for the offence committed.

However, there is an exception in regards to spouses. According to section 387(2) of the Penal Code, a wife does not become an accessory after the fact to an offence of which her husband is guilty by receiving or assisting him in order to escape punishment. The same applies to a husband assisting his wife. Courts have in various decisions explained that the exception does not apply to active participation in the commission of the crime; concealing evidence and interference with the administration of justice.