(This year, we published many inspiring and amazing stories that made us fall in love with the world – and this is one our favourites. Click here for the full list).

The students sit with their satchels on their desks, eager to get home after another long day of seven 50-minute classes. They listen patiently as their teacher makes a few announcements about tomorrow’s timetable. Then, as every day, the teacher’s final words: “OK everybody, today’s cleaning roster. Lines one and two will clean the classroom. Lines three and four, the corridor and stairs. And line five will clean the toilets.”

A few groans arise from line five, but the children stand up, grab the mops, cloths and buckets from the broom cupboard at the back of the classroom, and trot off to the toilets. Similar scenes are happening at schools across the country.

Most first-time visitors to Japan are struck by how clean the country is. Then they notice the absence of litter bins. And street sweepers. So they’re left with the question: how does Japan stay so clean?

The easy answer is that residents themselves keep it that way. “For 12 years of school life, from elementary school to high school, cleaning time is part of students’ daily schedule,” said Maiko Awane, assistant director of Hiroshima Prefectural Government’s Tokyo office. “In our home life as well, parents teach us that it’s bad for us not to keep our things and our space clean.”

You may also be interested in:

• Japan’s unusual way to view the world

• The complex art of apology in Japan

• The truth about mindfulness

Including this element of social consciousness in the school curriculum helps the children develop an awareness of, and pride in, their surroundings. Who wants to dirty or deface a school that they have to clean up themselves?

“I sometimes didn't want to clean the school,” recalled freelance translator Chika Hayashi, “but I accepted it because it was part of our routine. I think having to clean the school is a very good thing because we learn that it’s important for us to take responsibility for cleaning the things and places that we use.”

On arriving at school, students leave their shoes in lockers and change into trainers. At home, too, people leave their street shoes at the entrance. Even workmen coming to your house will remove their shoes and pad around in their socks. And as the schoolchildren grow, their concept of what constitutes their space extends beyond the classroom to include their neighbourhood, their city and their country.

Some examples of extreme Japanese cleanliness have gone viral, like the seven-minute Shinkansen train-cleaning ritual that has become a tourist attraction in its own right.

Even Japan’s football supporters are cleanliness-conscious. In World Cup football tournaments in Brazil (2014) and Russia (2018), the national team’s fans amazed the world by staying behind to pick up rubbish from the stadium. The players also left their dressing room in immaculate condition. “What an example for all teams!” tweeted FIFA’s general coordinator Priscilla Janssens.

“We Japanese are very sensitive about our reputation in others’ eyes,” Awane said. “We don’t want others to think we are bad people who don’t have enough education or upbringing to clean things up.”

Similar scenes unfold at Japanese music festivals. At the Fuji Rock festival, Japan’s biggest and oldest festival, fans keep their rubbish with them until they find a bin. Smokers are instructed to bring a portable ashtray and to ‘refrain from smoking where your smoke can affect other people’, according to the festival website. How different to 1969’s Woodstock festival, where Jimi Hendrix played to a handful of people amid a vast morass of trash.

We don’t want others to think we are bad people who don’t have enough education or upbringing to clean things up

Examples of social awareness abound in daily life too. Around 08:00, for instance, office workers and shop staff clean the streets around their place of work. Children volunteer for the monthly community clean, picking up rubbish from the streets near their school. Neighbourhoods, too, hold regular street-cleaning events. Not that there’s much to clean, because people take their litter home.

Even banknotes emerge from ATM’s as crisp and clean as a freshly starched shirt. Nevertheless, money gets dirty, which is why you never put it directly into someone’s hand. In shops, hotels and even in taxis, you’ll see a little tray to place the money. The other person then picks it up.

Invisible dirt – germs and bacteria – are another source of concern. When people catch colds or flu, they wear surgical masks to avoid infecting other people. This simple act of consideration for others reduces the spread of viruses, thereby saving a fortune in lost work days and medical expenses.

So how did the Japanese become so clean-conscious?

It certainly isn’t a new thing, as mariner Will Adams found when he anchored here in 1600, thus becoming the first Englishman to set foot in Japan. In his biography of Adams, Samurai William, Giles Milton notes ‘the nobility were scrupulously clean’, enjoying ‘pristine sewers and latrines’ and steam baths of scented wood at a time when the streets of England ‘often overflowed with excrement’. The Japanese ‘were appalled’ by the Europeans’ disregard for personal cleanliness.

In part, this preoccupation is born of practical concerns. In a hot, humid environment like Japan’s, food goes off quickly. Bacteria flourish. Bug life abounds. So good hygiene means good health.

But it goes deeper than that. Cleanliness is a central part of Buddhism, which arrived from China and Korea between the 6th and 8th Centuries. In fact, in the Zen version of Buddhism, which came to Japan from China in the 12th and 13th Centuries, daily tasks like cleaning and cooking are considered spiritual exercises, no different from meditating.

“In Zen, all daily life activities, including having meals and cleaning the space, must be regarded as an opportunity to practice Buddhism. Washing off the dirt both physically and spiritually plays an important role in the daily practice,” said Eriko Kuwagaki of Shinshoji Temple in Fukuyama, Hiroshima Prefecture.

Washing off the dirt both physically and spiritually plays an important role in the daily practice

In Okakura Kakuro’s The Book of Tea, his classic book about the tea ceremony and the Zen philosophy that infuses it, he writes that, in the room where the tea ceremony is held “…everything is absolutely clean. Not a particle of dust will be found in the darkest corner, for if any exists the host is not a tea master.”

Okakura wrote those words in 1906, but they still hold true today. Prior to a tea ceremony at the Seifukan tea house in Hiroshima’s Shukkeien Garden, you’ll see the tea master’s kimono-clad assistant on her hands and knees dabbing the tatami floor with a roll of sticky brown-paper tape, picking up every speck of dust.

So why aren’t all Buddhist nations as zealously clean as Japan? Well, long before the arrival of Buddhism, Japan already had its own indigenous religion: Shinto (meaning ‘The Way of The Gods’), said to enshrine the very soul of the Japanese identity. And cleanliness lies at the heart of Shinto. In the West, we are taught that cleanliness is next to godliness. In Shinto, cleanliness is godliness. So Buddhism’s emphasis on cleanliness merely reinforced what the Japanese already practiced.

A key concept in Shinto is kegare (impurity or dirt), the opposite of purity. Examples of kegare range from death and disease to virtually anything unpleasant. Frequent purification rituals are necessary to ward off kegare.

“If an individual is afflicted by kegare, it can bring harm to society as a whole,” explained Noriaki Ikeda, assistant Shinto priest at Hiroshima’s Kanda Shrine. “So it is vital to practice cleanliness. This purifies you and helps avoid bringing calamities to society. That is why Japan is a very clean country.”

This concern for others is understandable in the case of, say, infectious diseases. But it also works on more prosaic levels, like picking up your own rubbish. As Awane put it: “We Japanese believe we shouldn’t bother others by being lazy and neglecting the trash we’ve made.”

Examples of ritual purification abound in everyday life. Before entering a Shinto shrine, worshippers rinse their hands and mouth in a stone water basin at the entrance. Many Japanese take their new car to the shrine to be purified by the priest, who uses a feather duster-like wand called onusa that he waves around the car. He then opens the doors, bonnet and boot to purify the interior. The priest also purifies people by waving the onusa from side to side over them. He will even use it to purify land on which new building is about to commence.

If you live in Japan, you soon find yourself adopting the clean lifestyle. You stop blowing your nose in public, make use of the hand sanitizers provided for customers in shops and offices, and learn to sort your household rubbish into 10 different types to facilitate recycling.

And, like Will Adams and his castaway crew back in 1600, you find your quality of life improves.

Then, when you return to your homeland, you’re shocked by barbarians who sneeze and cough in your face. Or stomp into your house in dirty shoes. Unthinkable in Japan.

But there’s still hope. After all, it also took a while for Pokémon, sushi and camera phones to sweep the world.

Why We Are What We Are is a BBC Travel series examining the characteristics of a country and investigating whether they are true.

Join more than three million BBC Travel fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter called "The Essential List". A handpicked selection of stories from BBC Future, Culture, Worklife and Travel, delivered to your inbox every Friday.