That actually depends on a number of things
Он испортил мне настроение - is a good general way of saying "he spoiled my mood"
Он мне испортил настроение - is more like saying "it was me whose mood he spoiled"
However, with a neutral intonation they both can be used interchangeably to convey the first "general" meaning without any problem. Although, when you put these two on paper, the last one kind of suggests the shift of stress to мне.