The textbook presentation of a topology as a collection of open sets is primarily an artefact of the preference for minimalism in the standard foundations of the basic structures of mathematics. This minimalism is a good thing when it comes to analysing or creating such structures, but gets in the way of motivating the foundational definitions of such structures, and can also cause conceptual difficulties when trying to generalise these structures.
An analogy is with Riemannian geometry. The standard, minimalist definition of a Riemannian manifold is a manifold $M$ together with a symmetric positive definite bilinear form $g$ - the metric tensor. There are of course many other important foundational concepts in Riemannian geometry, such as length, angle, volume, distance, isometries, the Levi-Civita connection, and curvature - but it just so happens that they can all be described in terms of the metric tensor $g$, so we omit the other concepts from the standard minimalist definition, viewing them as derived concepts instead. But from a conceptual point of view, it may be better to think of a Riemannian manifold as being an entire package of a half-dozen closely inter-related geometric structures, with the metric tensor merely being a canonical generating element of the package.
Similarly, a topology is really a package of several different structures: the notion of openness, the notion of closedness, the notion of neighbourhoods, the notion of convergence, the notion of continuity, the notion of a homeomorphism, the notion of a homotopy, and so forth. They are all important, and it is somewhat artificial to try to designate one of them as being more "fundamental" than the other. But the notion of openness happens to generate all the other notions, and has a particularly elegant and simple axiomatisation, so we have elected to make it the basis for the standard minimalist definition of a topology. But it is important to realise that this is by no means the only way to define a topology, and adopting a more package-oriented point of view can be preferable in some cases (for instance, when generalising the notion of a topology to more abstract structures, such as topoi, in which open sets no longer are the most convenient foundation to begin with).