Until something happens to introduce a bunch of microbes - for example opening it and exposing it to the air!It DOES need it less than regular milk. Because the UHT process - boiling it, basically - kills most of the "resident bacteria", it takes far longer for it to build back up to dangerous levels than normal milk.
And, back in Pedant's Corner, the UHT process specifically does not boil the milk - doing so would completely denature the proteins. The trick to UHT, and how it differs from pasteurisation, is that it uses much higher temperatures (c. 120°C from memory) but for only a very short time which is enough to kill most microbes but not boil the milk and is then rapidly cooled back down to near freezing. Pasteurisation uses lower temperatures but for a longer period of time. As you might tell, I did the dairy tour several times - an "advantage" of having a parent work there.