The Indian leader made the televised remarks at a meeting with Putin in the Kremlin.
Ukraine says it has recovered fragments of a Russian Kh-101 cruise missile at the hospital, which was hit on Monday during a wave of Russian attacks that killed at least 41 Ukrainians across the country.
Russia said, without providing evidence, that it was a Ukrainian anti-missile system that struck the hospital.
Modi told Putin that the death of innocent children in war, conflict or a terrorist attack was "very painful". He also said that a solution to the war in Ukraine "cannot be found on the battlefield ... we have to find peace through talks".
Putin, speaking before Modi, said their two countries enjoyed a special strategic partnership and thanked him for his efforts to find a peaceful solution to the war.
He welcomed Modi in the Kremlin for talks on deepening the bilateral relationship, a day after the United States said it had raised concerns with India about its ties with Moscow.
"Our relations have the character of a particularly privileged strategic partnership," Putin said.
"I thank you for the attention you are paying to the most acute problems including trying to find ways to resolve the Ukrainian crisis, above all by peaceful means, of course."
India has become an increasingly important partner for sanctions-hit Russia as it shifts its trade away from the West and seeks to demonstrate that Western attempts to isolate it have failed.
India has refrained from criticising Russia over the war and has increased its purchases of cheap Russian oil to record levels, while urging Ukraine and Russia to resolve their conflict through dialogue and diplomacy.