Today, as it was originally, the principal purpose of neckwear is to add luxury and colour to the austerity of business attire as reinganum has said.
The tie as we know it has been around since the 1920s, but the four-in-hand (the term for the modern tie with one knot and two dangling tassles) was in fashion in the 1860s in England. Unlike its progenitors which warmed the neck, or simply made a statement of fashion, the late 19th century variety served the purpose of showing the wearer's affiliations.
With the expansion of English public schools during the late 19th century came the tradition of intercollegiate sports. Sporting colours became de rigeur and these were often shown in their ties (coloured stripes, club crest, emblems etc) and we still see this today in many schools.
As said above, to wear one is not compulsory, but to do so occasionally adds a touch of flamboyant finesse and professionalism to an otherwise dull or casual outfit.