He obviously knew who was looking after his dog while he was in the house and probably assumed they had taken the dog to the house. His dog probably misses him and was likely nice for both of them to see that the other was well.
Most people who own a dog do leave the house sometimes, and they do go on holidays and leave their pets with a family member or in a kennel so him leaving the room was no crueller than that.
I thought it was crueller the time they had someone's dog and the dog could hear them and started to howl and they never got the treat because they didn't press the button. That was unkind on the dog, to know they were there and not see them.