In my mind, it's not that inflation is good, but that deflation is far, far worse. The problem with deflation is your money buys more tomorrow than today, so you hold off spending it. Done en masse, that causes demand to drop. With people buying less, companies have to lower prices further, which means more deflation. It's a self-perpetuating cycle.
Perhaps ideally we would be right on the knife's edge between inflation and deflation, but we really do not have the ability to control the economy to that level of precision. The Fed can manipulate interest rates, print money, and that's about it. Congress, if it wants to, can pull economic levers by raising and lowering taxing and spending. But these tools are not precision instruments, and they take months to reveal their effects.
If you try and aim for precisely 0% inflation, you're likely to end up swinging between -1% and 1%. Which means you'll be spending significant time in deflationary territory, risking a deflationary spiral. The Fed aims for a 2% inflation target. This gives them some buffer to hopefully keep us out of deflation.