The importance of writing understandable code
There are a ton of blog posts and several books on the topic of readable code, containing far more eloquent and complete arguments than one can make here (or that I could come up with myself). Depending on their level it's well worth sharing some extracts of well-written texts directly to show the importance of understandable code. 

The most fundamental reasoning behind readable code is that people need to read code, not just computers. Or like @ben-i says here: 


  First, right from the beginning, and repeatedly, I talk about the
  two audiences for code: the computer and people. These two
  audiences have completely different needs. I come back to this theme
  with every new structure that I talk about, discussing coding style
  and norms with if statements, variable declarations (naming
  conventions), for loops (hey, why do we avoid break statements?), etc.


Novice programmers typically give their total focus to getting code to do what they want: make it compile and then give the right output. That's really hard when you're starting out, and it's understandable that they give 'working' priority over any other qualities like 'readability'. As they mature, programmers learn that making some code work isn't the only goal. Once you can write code that works you realise there are other things to achieve too, which is where all other sorts of software engineering practices come in.

Readability is super important because most code will be read many many times more than it will be written. I think this is the most important message to get across, and it drives all the different aspects like formatting &amp; naming. I suggest teaching and discussing this core concept and keep coming back to it whenever talking about a new aspect. 

It's one thing to get students to understand the importance, but another thing to make them bother to do it when 'getting it working' is so much more an immediate problem. To some extent that's fine, but even novice programmers should be taught the value of writing readable code because it makes their own coding easier. 

I guess there's a few approaches that can be used in tandem: 


Discuss why it's important. Perhaps a sports analogy: when you're starting out with [insert sport here] you just care about hitting the ball (etc). But the top sportspeople in the world spend all their time honing their technique to get better results. Writing readable code is one of the things that professional programmers spend time improving and perfecting all their careers. It makes you better. It makes you faster. It lets you achieve far greater things. It helps you work as a team. 
Break down different aspects of readability and give exercises on them, the simplest being to have students write and also review code where the approach hasn't been followed at all, e.g. with indenting, bad variable naming, bad comments, etc. Get them to desk-check the execution or result of some poorly written code versus well-written code.
Have them read &amp; discuss articles about readability &amp; maintainability. Depending on what level the students are at they should given reading about this and discuss it in class, even just to appreciate that it's an important ongoing topic in the CS community.
Mark them down for various aspects of poor readability. Even if they just follow the rules for the benefit of marks that's better than not doing it; gets them into the practice and at some point they'll appreciate it. 
Have them review other students code regularly, either in a group or individual setting. 
Teach the benefit of readable code as you're writing it. Once you're writing more than a trivial piece of code you always have to re-read it and think about what's going on. It's difficult even for the original author to read poorly-written code; by following guidelines to write readable code they will actually find it easier to write code.