Man has free will. That is part of the plan. If there was no choice but good then there is no free will
Free will is an illusion.
Your actions are determined by the body and mind you were born with, and how they react to their surroundings, and lessons learned from past experiences.