Napoleon III was already upset - 2 months earlier on his way south, Garibaldi landed a smaller force in Papal States - warned that more was to come. France and rest of Catholic Europe would act if the Pope / city of Rome were threatened
Cavour was aware that many men who joined Garibaldi were Mazzinians - 60,000 men. They were opposed to the Church and its teachings and would be only too glad to join in an attack on Rome . They were also Republicans and this posed another threat
Cavour and Victor Emmanuel must have had some doubt about whether even Garibaldi could maintain control over such a large army of irregular soldiers and enforce on them obedience to that cause he said he was supporting Italy and Victor Emmanuel -becoming very difficult for Cavour
Cavour’ most pressing need was to stop Garibaldi from attacking Rome - by sending an army from Piedmont through the Papal States to meet before Rome
The Pope didn’t want Garibaldini or Piedmontese troops in his territory- Cavour went anyway. They defeated a papal army and civilians resisting the invasion were shot as traitors to the cause of a united Italy