First, all shocks tend to be transitory and eventually fade away; by this logic, the Fed should never respond to any shocks, but it sometimes does, as it should. Second, the macroeconomic models we use to guide policy typically have cost shocks built in that cause inflation to move.
In those models, appropriate monetary policy responds to these inflation movements; it doesn’t ignore them, even though they are transitory. Finally, the choice to take a policy action depends on how large the shocks are and how long they are expected to persist. To make this point clearer, consider a snowfall, which we know will eventually melt. Snow is a transitory shock.