Your template is being modified by the DOM because you're inserting it into a <div>
as "HTML", which it isn't. It's doing exactly what a browser would do if you gave it that markup. It's putting the {{# Users }}
in the nearest available valid place to put it.
This is the same reason your template is originally stored in a <script>
tag. You should always use <script>
tags to hold your templates, and you should always use .text()
to read and write them:
var $newDcsTemplate = $('<script/>').text($('#dcs-template').text());
console.log($newDcsTemplate.text())