The reason electric potential has to be constant is that the electric field must be 0. Electric field must be 0 because otherwise, the free electrons would accelerate and redistribute themselves to make the field 0. This doesn't apply to an insulator, which has no free electrons, so the potential can be non-constant (and electric field can be non-zero).
agree with ideasrule. Want to add a bit more: In case of semiconductors the electric field inside is reduced but not nullified. If you want to learn more you may study dielectric strength.