The law functions as formal embodiment of a moral code, not as free-standing substitute for it.
Because people's desire to be comfortable supersedes their desire for self knowledge and well being, they avoid any form of discomfort. This is the impulse that drives us to repress undesired emotions, thoughts, and past trauma.