I believe nastiness is often a chain effect. Someone was nasty to them and so they are nasty to someone else. Maybe it triggered a memory. Maybe it hit too close to home. Maybe they had a really bad day. Maybe someone posted nastily on a thread they made on a forum and so they decided since someone did it to them, it was okay for them. Sometimes what someone else might find nasty, the person who posted it thought it was perfectly fine. There's no one reason.
I also believe the same for kindness.