The match at Stadio Luigi Ferraris was goalless until the final attack of the first half, when Milan Skriniar's clearance struck centre-back partner Ranocchia and flew into the Inter net on Saturday.
Goran Pandev scored against his former club in the 59th minute and an Inter side lacking injured duo Mauro Icardi and Ivan Perisic were devoid of attacking inspiration for the most part.
"It was a game in the balance and in the first half the best chances came to us, but when you happen to have such an episode as the one just before the interval, in a period like this, it is not easy to regain confidence," Spalletti told a post-match news conference.
"However, we came back from the locker room to try to play the game and stay in their midfield.
"But we needed more balance. We could not handle the ball with the quality we should have. The lack of tranquility caused everything to turn against us."
Inter still have only one win in 2018 and will drop out of the top four in Serie A if Lazio beat Verona on Monday.
Spalletti acknowledged a drain on their confidence.
"The team did not make a bad performance, we had to stay in the game and then wait for the right moment to take the lead," he added.
"We are in a fragile moment, we have to grow from time to time. It is not easy to turn things around suddenly.
"We are trying to work to do something different and I think we are going in the right direction.
"It would have been useful to consolidate these changes but we cannot reject the choices made. They were not decisive in the defeat."
Inter will get a chance to turn things around with a Serie A clash against bottom side Benevento next Saturday.