My understanding is that Adam and Eve represent the human race and God knew that they would either obey Him or not and so gave them the choice to choose. God knew which way He would go if they sinned or not.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.