Another reason why asking for a doggy bag may be viewed as impolite is that it suggests that the restaurant didn’t provide enough food. In many cultures, it’s a sign of hospitality to provide guests with more than enough to eat. Asking for a doggy bag implies that the host didn’t do a good job of providing for their guests.
It’s also worth considering that in some cultures, meals are an important social occasion. They are a time to connect with others and enjoy each other’s company. Asking for a doggy bag may be viewed as a sign that the person is more interested in taking the food home than spending time with their companions.