Is it just coincidence that the Moon follows the ecliptic? Or has it been gravitationally steered that way because of how it was formed?
No, this is not entirely a coincidence, though perhaps not in the way you expect (and other answers have indicated): it may have been coincidal at formation, but is required for long-term stability of the Moon-Earth system itself and, possibly, Earth climate.

The formation mechanism of the Moon (or the Moon-Earth system) is still debated. The favoured model involves a collision (between a pre-Earth and a Mars-sized object), when the resulting orientation of the Moon-Earth orbit depends critically on the impact parameters, which are essentially random, i.e. coincidal. Conversely, if the Moon-Earth system formed by some form of capture (possibly involving some surrounding gas to absorb the excess energy), a orientation in the eccliptic is more likely.

Howerver, the formation mechanism is not all there is to this. It is also required that the Moon-Earth system remains stable over 4.5 Gyr. This excludes any orbit initially circular and inclined by more than $i=\arccos\sqrt{3/5}\approx39.2^\circ$, when the Kozai mechanism would result in a collision of the Moon with Earth within a few years. The critical incliniation for a non-circular orbit is even smaller.

Even an inclination $i\approx30^\circ$ may not be viable, since it may imply that the Earth's spin axis (which is after all tidally coupled to the Moon's orbit) would be/have been tilted considerably stronger than by merely $\approx23^\circ$. A strong tilt of the Earth spin axis would have significant consequences for the Earth's climate and may well have prevented the formation of higher live forms. This is essentially a weak form of the antropic principle.