John 11:35. You choose the shortest verse in the Bible to ask for commentary? The short answer is Empathy. Let me paint a lengthier picture:
John 11:1-6
Lazaus is sick, one of his sisters sends for the healer, Jesus. The other sister is mentioned as "that Mary which anointed the Lord with ointment....". A reference found in all four gospels. Jesus says this will be an opportunity to glorify god by increasing faith and his love for Lazaus and his sisters is emphasized yet he waits 2 more day to make his journey.
John 11:19-27
Lazaus' sisters are in mourning and other jews come to comfort them (wailing and crying ... you've been to wakes like that, yes). Martha, the less hysterical of the sisters goes to meet the healer at the edge of town. She professes her faith in him. "Had he been there a little sooner all would be fine". Jesus says he will be resurrected and Martha answers in faith; "In the resurrection at the last day".
John 11:28-32
Martha goes and quietly tells Mary that Jesus has arrived but she is an emotional reck and jumps up to run out to him. All the jews in her house followed to see what stirred her to leave in haste. Mary finds Jesus and falls down at his feet crying, sobbing, full out in agony. With tears running down her face, grasping at his legs she says in faith; "Lord, if you had been here, my brother would not have died".
Now this is the important verse that answers your question.
John 11:33-36
When Jesus saw her weeping and all the jews with her crying also, he groaned in the spirit and was troubled.
"Where have you laid him?" He askes and then "Jesus wept" and all the jews there saw with thier own eyes his love.
In other words, these people moved him. Through thier faith in him, thier love for each other, thier pangs of heart and loss. Most notably that of the sorrow that Mary felt, the women that symbolically anoint him and wiped his feet with her hair. He simply was overcome with love and empathy.
That was the motivate of the author of John. He took a parable from Luke 16:19-31 (Lazaus in heaven and the rich man in hell) and depicts the Logos, the "Word" in John 1, as flesh and blood incarcerate. This story fits into the first of the four part sections of the only non-synoptic gosple (book of signs section). I hope this agnostic was able to answer your question. I "study" this stuff for reasons other than faith.