'Ruining someone's mood' is an idiom. In the example, 'Ruining someone's mood' means that the atmosphere was spoilt. Someone's mood depends on how they are feeling at a particular time.
So if the atmosphere is initially neutral or good, and then Joe said something that was opposite to what was expected (in this case something negative or uncomfortable), then the atmosphere will now be more negative.
Another example of 'ruin someone's mood':
We were having such a nice conversation over dinner, but Jane had to ruin my mood by talking about something disgusting.
I hope this helps.