One of the features of microcontroller design is the reliability of timing and the ease you can do it. Can you get something like the Pi to act reliably in real time with consistent task cycles? Sure, but it is a lot more work and there are a lot more things that can 'go wrong' on you and effectively snag things up. This usually isn't an issue when you're dealing with a task that is relying on just one controller, but rather tends to come into play more when you have a bunch of them handling different parts of a much larger system that needs to work in sync.
You can get around the timing thing with more work and sometimes more hardware/sensor checks, but having helped retrofit an industrial system to use 'modern' computer hardware I have to say that there is a kind of elegance to the timing factor of microcontrollers, and stepping out of that can quickly cause a project to snowball into a nightmare of implicit sync controls and error checking that 'just happened' by design of the original system we were replacing.