The reasons you suggest do happen. And other causes are possible too.
Perhaps the recording session itself wasn't on-pitch (maybe the band was playing for many hours and didn't re-tune in the middle). There's the famous case of The Beatles' Strawberry Fields Forever where there were 2 takes that they liked: the beginning of 1 take and the ending of the other. Problem was: the 2 takes were out-of-tune with each other! So they mastered by starting one, slowing adjusting the speed until they matched, then cross-fading to the other take, and on to the end.
It can also happen that the pitch was adjusted in order the change the playing time of the song. Maybe it clocked at 3:15, but the producers want the song to be an even 3 minutes.