Well, for one, once we part ways, I usually befriend them. Just not while we are working together. I am super friendly and outgoing, and will talk to them an all, but I keep a lot of my life private for good reason. I do not like to give people enough rope to hang me with.
I'm not perfect, and it's not like I haven't ever broken my own rule, but I think I have been burned all but one time. I've seen how good of "friends" coworkers are when things like promotions, salary increases, etc. are on the line.
Like the group of philosophers, Wu-tang Clan, once said, "protect ya neck, kid"