In this article, we present what we believe to be a simple way to motivate the use of Hilbert spaces in quantum mechanics. To achieve this, we study the way the notion of dimension can, at a very primitive level, be defined as the cardinality of a maximal collection of mutually orthogonal elements (which, for instance, can be seen as spatial directions). Following this idea, we develop a formalism based on two basic ingredients, namely an orthogonality relation and matroids which are a very generic algebraic structure permitting to define a notion of dimension. Having obtained what we call orthomatroids, we then show that, in high enough dimension, the basic constituants of orthomatroids (more precisely the simple and irreducible ones) are isomorphic to generalized Hilbert lattices, so that their presence is a direct consequence of an orthogonality-based characterization of dimension.