At first pay attention that those people who you mentioned, going to this shrines to offer their prayers (Salat) to Allah.so, they won't worship graves there.
And "places of worship" in this hadith, means places which people worship graves there instead of Allah.
A fine point of conscience we should not forget is that God "Almighty" should be worshiped and obeyed, but the Prophet "PBUH" and Salehin just should be obeyed;only God has the right of be worshiped and he doesn't have any partner.
Prayer, trust, ask for assistance and help-seeking for problem resolution, healing diseases and...are Contents of worship and are shared only with God, And the authority to reject and acceptance of them is for God.
Solving problems isn't the right of Salehin, prophets and messengers, Also they couldn't do that,too .So worshiping them for Solving problems is shirk also causes God wrath.
In this regard, the Prophet Muhammad (PBUH) said to Ibn Abbas:
"إذا سألتَ فاسأل الله، وإذا استعنت فاستعن بالله" (al-Jami` as-Sahih by
ibn Isa at-Tirmidhi)
If you ask for something, ask it only from Allah;and if you will help, request it from God!"
Pay attention to this prayer of Prophet (PBUH)
"اللهم لا تجعل قبرى وثنا يصلى إليه فإنه اشتد غضب الله على قوم اتخذوا
قبور أنبيائهم مساجد "('Ata ibn Yasar,ak raja malek)
"O Allah, do not make my grave an idol to be worshipped after me!"
Surely the Lord gets angry of who makes their Prophet 's grave,place of worship.
Another hadith says:
ألا وإن من كان قبلكم كانوا يتخذون قبور أنبيائهم و صالحيهم مساجد ألا
فلا تتخذوا" القبور مساجد إنى أنهاكم عن ذلك"(Sahih Muslim)
Be warned, there were some of you who already put their prophet and salehin 's graves, worship places and I would prohibit you from doing this.
Prophet (PBUH) because of Grave Worship danger, not only inhibit but also to show the ugliness of this action, curse the Jews- the first innovation grave worship makers-:
"قاتل الله اليهود اتخذوا قبور أنبيائهم مساجد"(Sahih al-Bukhari)
"May Allah's curse be on the Jews for they built the places of worship at the graves of their Prophets."
Built the places of worship (mosque) at the graves of their Prophets means making graves, a place for worshiping which is wrong Because mosques are places which people present worshiping to Allah not others. And Prophet (PBUH) Curse of Jewish people because they attention to other than God in their worshiping and worshiped Servants instead of God.
At the end notice that You can ask salehin and Prophet to pray on behalf of you to Allah to solve your problems, but you cannot ask them to solve your problems(which is called tawassul (Recourse) ).