It's not masochism. The story is so engaging and compelling because it is not so far from reality. You can kind of relate to it and its characters because you may know a Niina, a Yoichi, a Kaede, or a Miichi irl.
To be fair, the story started with Niina and Michi meeting because they felt lonely in their own marriage and that developed into them having feelings for each other... I don't see how Michi is the homewrecker here.