Yes — Koopa Troopas are aligned with Bowser and serve as his standard infantry.
They are the ordinary foot soldiers of the Koopa army, the enemies you stomp through in the platforming stages, and their loyalty runs to Bowser rather than to Mario.
The confusion is understandable, since the broader Koopa species includes characters who are firmly on the heroic side — Bowser Jr. aside, there are friendly Koopas throughout the series. But the basic Koopa Troopa, as an enemy type, is on the wrong side of the conflict.