if God doesn't love anyone who is selfish or arrogant, nuts to all humanity.
this doesn't say anything about 'why' He loved them - it just states that He does.
So the sisters sent word to Jesus, “Lord, the one you love is sick.”
When He heard this, Jesus said, “This sickness will not end in death. No, it is for God’s glory so that God’s Son may be glorified through it.” Now Jesus loved Martha and her sister and Lazarus. So when He heard that Lazarus was sick, He stayed where He was two more days, and then He said to his disciples, “Let us go back to Judea.”
(John 11:3-7)
verse 2 talks about an action one of the three undertook --
(This Mary, whose brother Lazarus now lay sick, was the same one who poured perfume on the Lord and wiped his feet with her hair.)
but the text says He loves all three, not just Mary. so i don't think there's evidence here of Him loving these people because of what they do. that doesn't mean actions don't evoke His love, but that it's not what v. 2 is about -- v.2 is identifying who we're talking about, not explaining the statement in v. 5 that He loves them - because it's all three of them He loves, not just the one whose one action we're told about.
which is to say, i can't tell you what about their actions He appreciated because the text doesn't indicate He loves them because of their actions.