"And they attributed partners to Allah," meaning their deities that they made equal to Allah, making them gods "to mislead [people] from His way," meaning from the path of guidance.
﴿وَجعلُوا لله أندادا﴾ يَعْنِي: آلِهَتَهُمُ الَّتِي عَدَلُوهَا بِاللَّهِ؛ فَجَعَلُوهَا آلِهَةً ﴿لِيُضِلُّوا عَنْ سَبِيلِهِ﴾ أَي: عَن سَبِيل الْهدى.