If you don't want to make these guys angry (or develop a case of bad travel karma) there are a few things you should know before you visit a temple (or shrine) in Japan:
1. ShoesThe entrance of Japanese temples often have a place for you to remove your shoes. This isn't optional. Wearing shoes on tatami flooring is a major taboo.
Some temples provide storage shelves for shoes (you leave your shoes at the entrance). Other temples provide a plastic bag (you carry your shoes with you).
2. CamerasCameras are generally allowed inside temples. In some cases, you'll be asked not to take photos. This is taken seriously. When rules are posted — it's a good idea to follow them.
Many temples do allow photos. Leave your tripod at home. Most temples have banned them.
3. No SmokingThis is an obvious one. The history of Japanese temples and shrines is often filled with tragic fires. Most temples and shrines prohibit smoking anywhere on the grounds.
4. Very Important MossMany Japanese temples are 1000 years old (or older). Many receive thousands of visitors a day. It's important to do no harm at a temple. Sometimes it's the smallest things that are most delicate. For example, the moss in temple gardens is easily damaged.
5. SeizaTemples often offer lectures. In many cases, short lectures are mandatory if you want to see the temple's treasures and art.
If you find yourself attending a lecture you'll notice that everyone is sitting seiza. Give it a try. If you're not accustomed to seiza your legs will soon feel like they're on fire. If you feel the need, quietly switch to a more comfortable position on the floor (don't stand up).
6. Photo SensitivitiesIn Japan, it's considered bad taste to photograph a grave. If it's a 1000 year old grave it's okay. If it's a modern grave it's best not to photograph it.
7. When in RomeMost visitors to Japanese temples are domestic tourists from Japan. Signs and announcements are often in Japanese. Often the only way to know what's going on is to watch what other tourists do.
This sign is warning about poisonous snakes. Japanese warnings often have cute characters (but no English).