Hi,
The upper part of the "T" shape is there to prevent pushing the pin right through to the other side of the plastic bottom. When you go to stick the relay into a board, there is some pressure against the pin because the fit isnt perfect as the pin rubs on the side of the hole. If there was no upper part to the pin the inside guts would have to bear the force instead which could damage the inside parts, or even just push the pin up inside the casing where it would no longer be accessible for soldering.
Obviously the pin part is made for soldering on the foil side of the board of a single sided board for example.