Spinning a web is a metabolically very expensive process, requiring as it does a great deal of protein - protein which can only be recovered by either eating the spun silk again, or eating prey trapped by it. Spiders consequently have to be pretty smart about where and how they do it, because the ones who aren't tend not to reproduce. So it's usually a very safe bet that, wherever you see a spider web, it's there because that's where the prey tends to be. It can be interesting to see what sort of prey that is - for example, right now in the basement of my ~130-year-old house there are a couple of very happy cellar spiders enjoying a steady diet of pill bugs, and another by the kitchen radiator who all on her own solved most of an ant problem for me before I ever realized I had it.
They're actually very desirable animals to have around, in my thoroughly considered opinion, despite getting about as bad a name as wasps - and with just as little reason.