My theory is that it's due to the tonal ambiguity in writing short messages.
In longer form writing, it's easier to establish a tone. But with something like a text message, it's harder to convey, and it's easier to accidentally come across as being short or harsh. The trailing "lol" is like a little flag that says "hey, we're friends, and I'm not taking this too seriously, and I'm not mad or offended or anything!"
Just a theory though lol
