In 95% of cases that is entirely on the studios and/or theater's personal desire to not allow minors, it isn't illegal. You can take a 3 year old into an R-rated movie as long as someone older looking is there says they can, and are not IDed themselves or known to have any authority over what a child is and isn't allowed to watch. A lot of hotels don't rent rooms to people alone under 25 or so, that doesn't mean its illegal for hotel rooms not to rent rooms to younger people either.