There are no hotels in Koya-san itself, but there are about 50 temples that will accommodate overnight guests for a reasonable fee. The Shojoshinin is one of the few that will accept Westerners.
The rooms resemble those of a typical ryokan, but naturally they are smaller and more austere: just a single room with no private bathroom. The walls are paper, so you will know it if the guy in the next room snores.
Traditional Buddhist vegetarian meals (shojin-ryori) are served by trainee monks.
Guests are invited to observe the monks’ morning prayer service, but no photographs are allowed.
Each room has a booklet that lists the rules of the establishment. Most of the rules are similar to those of any inn, but some are unique. For example, no Japanese gangsters or members of violent nationalist groups are allowed to stay at the temple.
Also if you should die of natural causes while staying at the temple the monks will cremate and inter you there. They will send your family a death benefit of ¥100,000, and send a monk to attend your memorial service along with a floral arrangement.
This offer is hedged with a lot of exclusions and fine print. Not only are suicides or any sort of violent death excluded, but death from radiation poisoning or food poisoning will also disqualify you.