They weren't just being generous hosts; it turns out that those sails and masts on Cook's ships looked virtually identical to contemporaneous imagery of the Hawaiian god Lono.
This is Lono. Guess what he is god of?
Lono is a sex god, and his job is to cruise around on a rainbow and sprinkle the world with ... you don't want to know. By arriving not only on a vessel that looked just like Lono, but also on the same day as his annual festival "Lonomania," Cook presumably responded with the loudest "Hey everybody, we're all gonna get laid!" this side of Caddyshack.
Thus the captain, tempted by the perks of being a penis-king, decided to go along with the charade by allowing himself to be smeared with pig fat, and then showing off some fireworks he happened to have in his boat.
Capt. Cook ... the world's first Texan?