If God knew before he created us that we would be imperfect, why did He give us free will?

References: James 1:2-18, Matthew 25:14-20