The strict appearance of Russia’s customs and immigration officers comes from the fact that Russia has long been a deeply conservative society of Slav peasants with a rigid state hierarchy ruling over them.
Once you, being Russian, get a position with a uniform and the paycheck from the state, you are the person of power above all those more peripheral to the mighty Leviathan.
Also, once you get power, you’ll need to communicate it, clear and loud. The best way to communicate power is keeping distance. The easiest way to communicate distance is to act busy and dismissive, ask pointed questions, shake your head, never smile.
This applies equally to our fellow Russians, as well to the foreigners in never-ending lines at the immigration and custom control.
This is, by the way, not an original Russian recipe. My impression is that this is the universal code of power communication in traditional cultures.
Add to that the fact that in Russia a smile from a stranger means aggression. This starts fading away in large cities like Moscow and St. Petersburg, especially among younger, well-educated people. But many still hold to the opinion that flashing your teeth to strangers is a stupid American import, at best.