As specified in the link you provided, the setgid mode has the following effect :
any files or subdirectories created in that directory will inherit the parent directory's group id.
So, we do it to ensure that newly created files get the same group than their parent directory, which is good for collaboration between the member of a same project.
Look at the `id' command using your SSH access : you'll see your user, your user group, and the additional groups you belong to, i.e. the projects you belong to.
Without the setgid flag on directories, newly created files would get your user group, so they would not be available for your co-workers. However, you still have to set g+w permissions on files (manually or through your umask) for your co-workers to edit them.
Note that we also use groups to handle quotas : your project group has a 100 MB quota, your user group has a 1 MB quota.
So, the setgid flag on directories is not insecure. However, the cursed o+w permission is insecure. Try to set it on your files ;)