I think if i was just doing running to keep fit, i could probably do half the milage and half the speed i do, and still have a balanced lifestyle, with healthy eating etc. Doing a race provides an outlet to see what i am capable of, when i train hard, and i do like to train hard, go out and do 10-12 miles just for the fun of it, while pushing myself at the same time. Its a natural extension of training then.
You always know that unless you are an elite, then you are not going to come first, and there will always be someone quicker than you. I like to see other people around me though, all going off together, all focussed on the same goal, to get to the finishing line, to get that medal etc. There is something wonderful as well, about having crowds cheer you on, that some how get you through that hill.
I probably do a race about every 6-7 weeks, only half's though, but it is enough for me at the moment. But it is a motivator, and Brighton for example, it kept my running in check, when it was icy, cold, in the weeks, and months before, it made me still go out there, since i knew i had this race looming.
I think it is great for beginner runners too, to give them something to aim for, like a confidence booster, and maybe provide a channel for emotions, if for example they are running for cancer research, having lost their dad or something. You can see the pain etched on their faces, but they refuse to give up as they hit mile 7 etc.
Running is a very pure outlet therefore, and i do it, as much to see other people (see above) as i do to test myself.