Where he was, he saved between 700,000 and 860,000 Jewish lives.
That's not my number, that's the number computed by the Israeli diplomat, Pinchas Lapide.
What do you think he would have been able to do for the Jews in a prison cell?
What you are saying amounts to, "Pius XII didn't do enough to justify himself in my eyes". So what? He wasn't out to justify himself, but to do the will of God.
If Pope Pius XII had been jailed, he would have acted like Jesus in my eyes. Maybe that is too high a standard.