Up Helly Aa existed before that as the local midwinter festival, which was basically an excuse for the young men to get crazily drunk and set things on fire, particularly tar barrels. Then they would pull the burning tar barrels around through the streets while whooping it up. It was a seasonal festival- and as such, could possibly be quite ancient- but it was mostly a drinking binge and a reason to go a little crazy. The hilarity of drunk young troublemakers dragging burning tar barrels through the streets was lost on the more “respectable” members of the community, who managed to get the practice banned in the 1870s.
They relented a little bit a few years later, allowing a procession of people carrying torches, which is a little less chaotic than the flaming tar barrels. When the Duke of Edinburgh visited in 1882, the torch parade was played up quite a bit and turned into a spectacle. In 1889, someone first had the bright idea of burning a Viking ship, and the Shetlanders have done so ever since.
Festivals and customs like this one derive their meaning from their role in the community life, not from how ancient or “authentic” they are. By burning a Viking longship, Shetlanders are able to assert and confirm the island's traditional Norse connections and their own unique identity as a Scandinavian-Scottish community. The fact that their ancestors really burned tar barrels is not particularly important.