The Pylon is a necessity in any protoss base. It provides Psi, allowing additional troops to be warped in, and it allows nearby protoss structures to operate.
Protoss structures and units, to a lesser extent, draw their energy from a great psionic energy matrix that emanates from Aiur.
While a nexus provides a link to this matrix, khaydarin crystal-based pylons are needed to actually tap into the energy required to provide psionic energy to new colonies. Each pylon generates a short-ranged aura of energy, which can provide the power needed by structures and warp gates.
Pylons project a strong magnetic field which makes the ground beneath them impenetrable by "mortal means". The dark templar have their own version of the pylon in the form of the dark pylon. As circumstances grow increasingly dire for the protoss, the dark pylon has entered general use for the protoss alongside the regular pylon