Jesus dying on the Cross was part of God's plan...but those who implemented the plan were NOT acting virtuously, or "according to God's will", but according to their malice, and were punished accordingly.
God uses all things -- even the malice of men -- to accomplish His will, which no one can escape.
In Christ,
Matthew