It's random, freakish, pointless, ridiculous, and has nothing to do with the film at all.
It is indeed random, but it does have something to do the film in that it's when one of the character falls ill, and the aligator does come later on. (I watched recently, I still love it - the whole film I mean).