Well, when I leave my dogs (incidentally, all cockers) home, alone, cooped up, for long periods of time, they get mad. And how do they show me they get mad? You got it. Could be your dog is trying to tell you "Don't leave me home alone again like that!!!"

He may now longer be mad at you if he stopped doing it. But there is the scientific side as well. Just a thought, animals have feelings too.