Maybe it's because he ate something bad or got sick. It could be part of a plot twist to add drama.
Well, there could be various reasons. It might be due to a curse or a side effect of a new jutsu he tried. Sometimes, authors use this to show his physical or mental exhaustion after a tough battle.
Naruto throwing up in fanfiction could be because of stress, a poisoning incident, or even a reaction to a powerful enemy's technique. The possibilities are endless, depending on the creativity of the author.