Every governmental system needs an "emergency backup system": consider the consequences of not having an effective one in the USA.
A president is a politician, even if a retired one. A monarch has no political baggage and is beholden to no-one. In times of emergency, they can prove very valuable:
> King George V of UK setting up the National Government in 1931
> King Juan Carlos of Spain facing down the rebel generals in 1981
> King Albert II of the Belgians helping to sort out the impasse of 2010
They can also provide an element of continuity. In the UK, an incoming prime minister doesn't have access to all the papers of the previous government, since some are politically sensitive. The Queen has read them and discussed policies with her PM, so she can offer discrete explanations of why certain decisions were taken.