The Shillelagh spell description, in relevant part:
For the duration, you can use your spellcasting ability instead of Strength for
the attack and damage rolls of melee attacks using that weapon, and the weapon's damage die becomes a d8. (PHB, p. 275)
As written, the spell applies to all melee attacks with the affected weapon. It is not limited to only the Attack action. The Polearm Master feat, in relevant part:
When you take the Attack action and attack with only a [...] quarterstaff, you can use a bonus action to make a melee attack with the opposite end of the weapon. This attack uses the same ability modifier as the primary attack. The weapon’s damage die for this attack is a d4, and it deals bludgeoning damage. [Emphasis added] (PHB, p. 168)
The bonus attack is a melee attack, so you would be allowed to use your casting ability for the attack and damage rolls of the bonus attack (and the Attack action). However, while the Attack action uses a d8 for damage per the Shillelagh spell, the bonus attack uses a d4 damage die per the Polearm Master feat. This interaction was clarified by 5e designer and "official rules expert" Jeremy Crawford on 23 August 2014 in the following tweet exchange. When asked:
@JeremyECrawford If I cast Shillelagh on my quarterstaff and have Polearm Master feat, does the bonus attack deal d4 or d8?
@ArtificerAlf The bonus attack would use a d4. I like it: druid master of polearms!
The fact that Crawford did not say anything else of their interaction also supports the use of casting ability instead of STR for the attack and damage rolls.