Why is it unhealthy to be in a miserable marriage for the sake of the kids?

Unhappy environment. Kids need to witness love + good communications + forgiveness so they can grow up in harmony and be healthy physically and mentally. If they only in the opposite of all that, they will grow up in mental anguish and constant fear and can be damaged for life, depending on the degree of unhappiness (and the verbal + physical violence they witness or suffer from).