One hypothesis is, they feel offended in the first place, and are reciprocating. There is good evolutionary justification for Tit-For-Tat.
Other than that, I'm uncomfortable discussing the topic purely in abstract. My inclination would be to analyze actual online exchanges where someone is presumed to be "mean", and study the pragmatics, context, and outcomes.
Actually, an even better starting point would be to start with a single-blind test where we pick one such exchange and verify that more than one person, in a group of non-involveds, agrees on who is being mean.
(There is one person in particular who stands out in my memory as a smart meanie who I extensively engaged with, on my home turf as it were, who may provide good material for analysis; but since I was personally involved I'm loath to use that.)
The hard question is, what is the intended purpose of the presumed meanie ? It's hard to think of a way to ascertain that - what independent source of information would we have ?
There are cases were the context provides this information: if you analyze the transcript of a teacher's class, you can work from the assumption that the teacher intends to convey some knowledge. If you run into instances of "mean" (I'm sure this would turn up for some teachers) it is empirically testable whether these behaviours make appropriate contributions to the teacher's intent.
A big issue with most Internet exchanges is that people don't, most of the time, declare a well-defined intent. They're just passing the time, or so it appears. Possibly "mean" behavior is adaptive with respect to that intent, possibly not, it's hard to tell. Perhaps this lack of definite purpose is in fact a contributing cause of "mean" behavior.
My extended exchanges with the person I refer to above came to an end when, after a lot of back-and-forth, I asked them point-blank: "What is your purpose in having these discussions ? How well are they working out for you ?" That was the last I heard of them.
tl;dr: Sometimes, people don't try as hard as they could to be nice. If being nice is not a terminal value for you, here are some other things to think about which might induce you to be nice anyway.
There is a prevailing ethos in communities similar to ours - atheistic, intellectual groupings, who congregate around a topic rather than simply to congregate - and this ethos says that it is not necessary to be nice. I'm drawing on a commonsense notion of "niceness" here, which I hope won't confuse anyone (another feature of communities like this is that it's very easy to find people who claim to be confused by monosyllables). I do not merely mean "polite", which can be superficially like niceness when the person to whom the politeness is directed is in earshot but tends to be far more superficial. I claim that this ethos is mistaken and harmful. In so claiming, I do not also claim that I am always perfectly nice; I claim merely that I and others have good reasons to try to be.
The dispensing with niceness probably springs in large part from an extreme rejection of the ad hominem fallacy and of emotionally-based reasoning. Of course someone may be entirely miserable company and still have brilliant, cogent ideas; to reject communication with someone who just happens to be miserable company, in spite of their brilliant, cogent ideas, is to miss out on the (valuable) latter because of a silly emotional reaction to the (irrelevant) former. Since the point of the community is ideas; and the person's ideas are good; and how much fun they are to be around is irrelevant - well, bringing up that they are just terribly mean seems trivial at best, and perhaps an invocation of the aforementioned fallacy. We are here to talk about ideas! (Interestingly, this same courtesy is rarely extended to appalling spelling.)
The ad hominem fallacy is a fallacy, so this is a useful norm up to a point, but not up to the point where people who are perfectly capable of being nice, or learning to be nice, neglect to do so because it's apparently been rendered locally worthless. I submit that there are still good, pragmatic reasons to be nice, as follows. (These are claims about how to behave around real human-type persons. Many of them would likely be obsolete if we were all perfect Bayesians.)