To me, it's just somewhere to get changed before or after a match or workout, although I have seen a fair amount of sexual behaviour in locker rooms in the past. It's interesting to note that if there is any, it's usually a "straight" guy. I've been to a number of gay sports events around Europe over the years, sharing locker rooms with up to 200 guys at some tournaments and haven't seen anything sexual taking place, whereas I have seen a few incidents in my local gym.
I think for some guys it is a sexual environment, and probably more so these days because there's so little nudity around and porn and locker rooms are the only places where they have access to naked male flesh. I suppose there can be a certain element of fantasy to it too. The thing is that most gay guys can just go out and get it if they want, whereas the married guys with an itch to scratch don't have the same options and opportunities.
Another point is that sexual behaviour is much more likely to take place in locker rooms with privacy cubicles rather than those with open changing areas and showers.