You'll have to come, visit and try and get a sense of the social atmosphere yourself to decide, but personally, in my experience, there are ordinary people here who are upper working class, lower middle class etc in halls and places like Albany Park and Fife Park, because they're cheap...but the snobbery and cliqueishness which charcetrises St Andrews is unavoidable, really, is evident in everything from the housing prices to the weird traditions that this university is catered towards a particular demographic (they're currently trying to tear down some of the cheaper accomodation in Fife Park to make way for 6,000k a year flats)....the tone here is set by the upper middle classers and above.
Moreso than that, its a place where like I've said, theres a limited amount of mixing and socialising between social groups, as a previous poster has stated (ch0llima), for such a small place, its a sad fact that people just stick to their cliques, which is dissappointing and boring really- everyone needs a group, but whats a University experience without a sense of community and social mixing? There are a fair amount of people that don't wear designer clothes to Tescos, but you will feel in the minority as someone from a poorer background, I can guarantee it. I'd suggest going to a city-based Uni where you're more likely to mix with people from a similar background- and where a lot mroe socialising between and amongst people goes on which makes the whole social side of things way more reqarding...but again, its up to you, if you want the benefit of having St Andrews on your CV you may feel its worth sacrificing a better overall experience for....but as I said, visit, talk to other people when you do visit and try to get a sense of the place.