In many projects, templates are not formatted in the same way as in English Wikipedia. And in those projects where this is not so, each edit made through a visual editor can change the design of several dozen lines (usually removing or adding spaces). But since the final format is not common, other tools can change it back.
Now the only way to fix this is to specify a custom format for each of the thousands of templates. Instead, it's more appropriate to create a message in the MediaWiki namespace with the standard values for the block and inline formats and allow sysops to modify it.