This is also known as the Problem of Evil. The existence of a being who is omnipotent, omniscient, and omnibenevolent is not compatible with the existence of evil.