How to avoid CKeditor to change the HTML code?
I know that this is not the answer to your problem (which is annoying) but personally I would avoid putting a &lt;div&gt; inside a &lt;a&gt; tag. It is normally not allowed to put a "block" type of tag inside an "inline" type of tag.

So you could do the following:

&lt;a class="block"&gt;&lt;span&gt;Your stuff&lt;/span&gt;&lt;/a&gt;


and then add a CSS rule:

a.block,
a.block &gt; span {
  display: block;
}


This way you are HTML valid and CKEditor should not try to correct it.