Why has the Hayate no Gotoku anime switched studios so many times?
(I'm Japanese, so please excuse my English.)
First a bit of background:

Season 1: This season was a Sunday morning anime in Japan. Sunday morning anime means children anime. SynergySP is known as an anime studio for children.
Season 2: After this season, Hayate moved to the midnight anime for adults in Japan. To produce an anime for adults is the contrary to the SynergySP's corporate philosophy.

After that, you can read the Hayate's author, Hata's thought:

TVアニメが始まります。
第三期ではありません。
今回は新アニメ。
新しいハヤテのごとく！です。

Translation

The TV anime will start.
It is not the 3rd season.
It is a new anime.
New Hayate no Gotoku!

As for your question:

I've seen a few shows switch studios once, but switching twice seems extremely rare.

Typically when the timeslot moves from a morning/children anime to the midnight/adults anime, often times you will see a studio switch.