If the relay is very far from the microcontroller, then using an optocoupler close to the microcontroller, and a separate power circuit for the relays (completely isolated from the microcontroller), might make sense in an electrically noisy environment. That way, any currents induced in the long wires would have to be pretty big to affect the operation, since they'd only affect the relays.
For example, consider a DIY CNC or plasma table, with the relay controlling a spindle motor or coolant pump.
I personally really dislike designs where the logic and the motors share a ground. It is extremely common, but causes all sorts of issues; not the least of which are ground loops if you connect a computer in a separate mains circuit to the logic. The optimum location for the isolation is between the microcontroller and the stepper drivers, and costs very little (see e.g. SI86xx and ISO76xx digital isolators), even including Trinamic drivers with UART/SPI comms and not just the typical STEP and DIR pulse lines.