It's a way to convey tone through text. Sometimes the same comment can be taken in either a rude or a helping way, and prefacing it with "I don't mean to be rude" is a way of saying "please take this in the helping way."
When talking in person you can infer this through how they say it, but in anonymous text on the internet the disclaimer is helpful.