After searching through the Residential code I have found nothing that requires that rooms must have doors for privacy. Common sense and empirical evidence would say yes.
Is there a code section that requires sleeping rooms or especially bathrooms to have a door for privacy??
David McCabe