I create a member-only muc. If someone tries to get into it without being a member, he gets a message saying that the muc is members-only, so he needs to leave. It would be nice that a message could be sent to the muc owner so that when someone tries to get in but is kicked, he would know about it and eventually accept his membership.
There is a feature in XEP-0045 for requesting membership with a room : https://xmpp.org/extensions/xep-0045.html#register
It's in mod_muc in core already, but MattJ said that there are still some improvements he wants to make to it. Currently it can either automatically allow all registration requests for all rooms on the MUC service, or reject all of them
This is controlled by allow_unaffiliated_register = true/false
It would be nice to make it extensible, so plugins can choose the behaviour, and obviously it should be able to change per room