Thanks for the comment!
Selling souls doesn't end the game. I'm guessing you were serving Death and gave the souls to him, which raised your bad rep, making the red scale tip and making you die. The exit game button runs "get_tree().quit()" which doesn't seem to work in HTML5, and I'm not sure why the buttons don't work after going to the main menu.
To answer your question about the good and bad reputation:
You were gaining bad reputation (red) by killing people or selling souls to Death, and good reputation (green) by selling to Anubis. If your bad reputation outweighs your good reputation by 2x, you die.