I think you can immediately see the difference in the writing teams for the spinoffs and the team for P5.
Did we ever learn who the writers for P3/4 were? Same writers working on P5? Did they ever touch the spinoffs?
The person who wrote Persona Q was also responsible planning the social links in Persona 3 & 4. They had assistance from a sub scenario writer from Persona 4 as well.
Persona 4 Dancing All Night shares a couple of its writers with Persona 4 (with Wada as a director). One of the writers (Yuichiro Tanaka) is absent from all spinoffs.
Yuichiro Tanaka seems to be the X-factor, since he's only involved in the mainline Persona games.
Don't know/care about the Arena/Ultima writers. Ultimax apparently had like 5 writers though.
I can't imagine the writers being the only reason why the writing is good/bad. Time is probably a huge factor as well.