First of all it is important to make clear what economists are actually saying. Most economists believe that moderate inflation is better than moderate deflation, while high inflation or deflation would be considered undesirable. This is because both inflation and deflation are examples of price instability and in fact if all markets would be perfect, competitive and all prices fully flexible models tend to show that it would be desirable to have neither inflation or deflation over business cycle (you can see some example of such models in Romer Advanced Macroeconomics).
However, unfortunately we do not live in a world where all markets are perfect, competitive and where all prices are flexible. For example, wages might not be flexible because of minimum wage laws or because in many countries contracts are set for long term (for example, in the Netherlands where I live it is very difficult to fire someone with permanent contract or to force them to renegotiate their contract). However, even in countries where labor markets are more flexible it might be difficult to renegotiate wages or contracts quickly.
These rigidities create problem for an economy during recessions where in order for markets to equilibrate you usually need people to accept lower wages. Inflation, solves the issue above because it decreases people's wages in real terms without any need for negotiations. This can help to moderate recession because if real wages are too high during recession it will lead to above equilibrium level unemployment. In turn higher unemployment means people have less income to spend or invest which then just further reinforces the recession.
Also note while I focused mainly on wages the inflation has also other benefits as in the short-run it stimulates the economy (since higher product prices motivate firms to produce more before they realize they are higher due to inflation), it also helps to relax government budget constraint since government as a monopolist producer of money benefits from inflation and has some further benefits (see discussions of this in standard macro textbooks such as Blanchard et al Macroeconomics: A European Perspective or Mankiw Macroeconomics).
Lastly note that economy usually has no problem when it needs to increase aggregate wages during expansion. Wages are much more rigid downwards than upwards and consequently economy usually does not need deflation during expansions when real wages tend to increase.
Hence to sum up, most economists believe that it is better to have moderate inflation (most economists would argue around 2% per year), because it helps to 'grease' the wheels of economy. Inflation helps to moderate business cycle and to the extent that one agrees it is better to have milder recessions it is obvious policy prescription given our current understanding of macroeconomics.