:set nocompatible
is used to switch Vim from "compatible" mode to "nocompatible" mode.A lot of people put it at the top of their .vimrc, usually together with a comment telling that it's needed for many options and features to work correctly.
But Vim actually switches itself to "nocompatible" mode if it finds a vimrc. It can be the default vimrc in /usr/share/vim/vim7x/ or your own .vimrc, it doesn't matter.
You can test this by removing this line from your .vimrc, launching another Vim instance and doing :set compatible? With or without that line, you'll get nocompatible.
Having this line in your .vimrc essentially does nothing: it sets something "on" that was already "on". As such it's useless cruft but it is not dangerous.
The real problem with it is that it demonstrates a dangerous cargo cult trend among Vim users who copy/paste entire vimrcs from Github or top ranking blog posts without thinking about it for a second. Because this line and the comment appeared in a rather famous blog post(1) by a rather famous vimmer it's now just… everywhere.
I have a lot of respect for Steve Losh and I absolutely don't blame him for including this line in his post: it's useless but harmless so there's no big deal. I certainly have a lot of useless redundant stuff in my .vimrc, too. And I'm totally guilty of using his whole .vimrc verbatim when I started.
But all the people who copied this line from him or from others who copied it from others who copied it from him (who probably copied it from someone else, why not?) should show a little less lazyness, I believe. And a more critical mind.