One of the underlying ideas in gauge invariance is that the physics exist independently of whicheverthe coordinate parameterization (and thus gauge) we apply to the system.
For unit-preserving changes in coordinates, the Lagrangian (as a measure of the "energy" in the system") should thus have a value independent of which coordinates we choose.
The motivation for covariant derivatives, etc., is then to account for disagreements between coordinate systems (and the underlying physical manifold) of what makes a "straight line" or a "right angle".