My kids have never closed their doors to play. If they did when friends were over, I'd go knock gently, and open it, and ask why it was closed. It isn't necessary to close it. I'm not standing in the hallway eavesdropping.
They close it to change clothes (after swimming or getting changed for bed), and both kids like their doors closed at night when they go to sleep now (they are 13 and 16). Daughter likes hers closed at night b/c she doesn't like the light from the family room ... she likes her room DARK to sleep. Son, he closes his for privacy.
But really, it's never been an issue for us. I would probably say that if your status quo is different then I'd work on changing the status quo before I made a rule about when friends are over. Make sense?
We close doors in our house when we use the bathroom, or go to sleep. That's pretty much it. And always has been. If your family has a habit of closing doors at other times, then I would work on changing that so that "normal" is for doors to be open. It makes it a non-issue for the most part, when friends are over, in my experience.