God laid the straight path to guide us to Heaven. And He gave us the freedom to choose to walk it or not. He gave us this choice to teach us the difference between right and wrong, so we remember the necessity for righteous action.
Those who walk the straight path shall walk it for their own good, and those who abandon the straight path shall abandon it at their own peril.
The Straight Path: A Religious Guide to Finding and Fulfilling One’s Purpose, p. 2.