Consider these two circuits:
simulate this circuit – Schematic created using CircuitLab
Are they the same? In the lumped element model they are. However, our model neglects what may be a relevant fact: real wires have resistance. Let's introduce a couple schematics that model that:
simulate this circuit
Consider in the circuit on the right what happens as the current drawn by the motor changes. One moment it's off and drawing 0A, then it's on, and drawing 1A. This 1A must flow through R1 and R3. By Ohm's law, there must then be a voltage drop across these resistors of \$1A\cdot 1\Omega = 1V\$. With 1V of the supply voltage lost over each of R1 and R3, from the perspective of the microcontroller, the supply voltage is suddenly 10V, not 12V.
A lot of digital electronics don't like it when their supply voltage rapidly changes. Additional problems occur when there are multiple devices trying to talk to each other over a digital bus, but high currents in the supply rails are giving each device a different idea of what "ground" is. Look at "ground" for the MCU, and the motor in this case. All of the resistors have 1A in them, and thus 1V across them. "Ground" at the MCU is 1V different than "ground" at the motor! If these are digital devices which are signalling a "0" by making a voltage equal to "ground", they are not going to communicate very well when they can't agree on what "ground" is.
A solution to this is to run both of the power supply connections for each device all the way back to the battery or voltage regulator, and make all the power supply connections for each device there. This is the situation modeled in the circuit on the left. Here, when the motor switches on, there will be high current in R5 and R7. There will be some voltage drop here, but the motor won't mind. Meanwhile, the current in R6 and R8 is unchanged, and so too is the voltage. Thus, the supply voltage seen by the microcontroller is constant.
You don't have to do this all the time, for each device, but you do need to give some thought to where high currents will be running when your circuit includes such a device. Remember that all your wires have some resistance, and thus will experience a voltage drop when high currents run through them. Then plan your wires or traces so that the high currents don't flow through the supply for the sensitive components, causing noise issues.
This is but one possible explanation. Other answers will no doubt provide additional possibilities.