If you cast it so that its area covers an actual solid surface--such as the physical floor, wall, or ceiling of a room--then it remains in place. Notice the word "layered." This does not simply mean a big wet blob of webbing material dropped on something. It's been layered onto that surface, one layer at a time, building up until it's 5' thick.
If you cast it over an open space, but which has at least two anchor points, e.g. a room that is 50' high and has pillars running down its length, then the web will anchor to those points and stay, even though it is suspended in midair.
Now imagine you are flying on a giant eagle, and fall off. There are no anchor points, and no solid surfaces within range. The web will collapse in on itself, wrapping around any creatures who happen to be in its area, and then the spell will end at the start of your next turn. Likewise, you could not project the web outward from a tower; that's only one anchor point if used in that way. You could layer the web on the surface of the tower, to a thickness of 5'. But you couldn't anchor it to the tower and have it stick out the full radius of the effect.
It's just like if you were layering anything else on a solid surface.