According to the Bible God set this plan in motion from the beggining of time.
Considering that it was all part of the Big G's master plan and that he actually had no genuine freewill ability to do otherwise poor old Judas gets kind of a bad press.
Without him doing what he was put on Earth to do our sins would be unforgiven for all eternity.