The notion of "structure preserving" can be made precise in some contexts, by abstracting the notion of "set with structure". It can be done in different ways. For instance, since we are talking about category theory, a way is adopting Lawvere theories.
Say we are dealing with groups, then the fundamental idea is expressing the group axioms as commutative diagrams, and taking the "most general" category T having these commutative diagrams - called a Lawvere theory T of groups. More precisely, think of T as having "powers" 1, t, t\^2, t\^3, ... as objects (representing the cartesian products of sets), together with a "multiplication" morphism m : t\^2 -> t, an "inverse elements" morphism n : t -> t and a "unit" morphism e : 1 -> t satisfying the arrow formulation of group axioms.
Then a group can be interpreted as a product-preserving functor G : T -> Set, i.e. G(t\^n) = G(t)\^n, making G(t) into a group because G(m), G(n) and G(e) satisfy the arrow formulation of group axioms for G(t). It turns out that natural transformations between such functors G, F induce (and are induced) by set maps G(t) -> F(t) preserving the group structure.
This argument can be generalised for any Lawvere theory T: of rings, monoids, abelian groups, vector spaces (in this case we require the notion of multisorted Lawvere theory).
This is why the structure preserving maps fit with categorical composition: the very notion of structure preserving can be defined as morphisms of a category. However, structures can be defined in several ways, not included in the example above (e.g. fields cannot be described using Lawvere theories).