Both are grammatically perfectly fine, but they mean different things. Without any context (knowing the situation that the sentence would have occurred in, if there had been one), there is no way to tell which of the meanings is the ‘correct’ one—and whatever book you're using that tells you only phoned is correct is simply wrong, as such self-learning books often are.
Matt phoned while we were having dinner.
This means that at some point during the stretch of time when we were having dinner, we received a telephone call from Matt. Here, phoned does not refer to the entire phone conversation, but to the actual ringing up. The conversation may well have gone on for an hour, by which time the dinner of the person who went to pick up the phone was cold and everyone else had long since left the table.
But the dialling and picking up happened while we were having dinner.
Matt was phoning while we were having dinner.
This means that two things took place concurrently:
- We are having dinner.
- Matt is on the phone talking to someone.
The most obvious interpretation of the sentence is that it's an explanation for why Matt wasn't there at the dinner table: because he was talking on the phone in another room.
In this case, phoning does refer to the entire phone conversation, not just the dialling and picking up bit.