These buildings also change hands, whether between family members, or just outright sales, more so if a unit in the building is currently for sale, someone could access the building by showing interest, not even with the real estate agent but just telling the doorman you have a viewing. You wouldn’t have to hack the elevator at all and I doubt this perpetrator did. It would take a pretty vigilant doorman to stop this/determine the identity and purpose of all visitors.
Most of the doormen are there to provide additional services to the residents, like having a cab waiting when they are on their way out and other small conveniences, not so much as gate keepers especially since 99.99% of the people entering are no cause for concern.