I don't know, but my guess would be to move an attacker's attention to the tail and away from the head. Protects the head..

Some juvenile snakes have a bright colored tail that they use as a lure to attract prey. I haven't heard of red tails doing this, but it's a thought.