Did God do those things? Or did man act independently using their evil inclinations apart from God? God created us with free will, a result of that is that man can choose to disobey God and His law (and that is our default state - hostile to God).