Going to copy runem's brilliant post below. This is strictly his words, just copied here because the link doesn't work in the app-- I hope this is okay! Send any lingots and appreciation their way!
Well, it's one of those things caused by the eternal language change. Originally, røre was an intransitive verb, meaning it took only a subject and no object. Similar to how to sleep takes only a subject (you can't say I sleep you) but to punch is transitive (I punch you, subject and object). So in order to attach an object, you had to use a modifier, similar to how you can say I cause you to sleep (but not quite).
Another variant is berøre from the prefix be- which is a (no longer productive) modifier to turn a verb into a transitive verb (similar to smile - besmile in English. I besmile you - I smile upon/towards you). This prefix is found in a LOT of verbs in modern Danish, similar to Dutch and German (my research tells me).
Today, however, røre is used by many people as a transitive verb with the same meaning as røre ved and berøre. To me, it still sounds a bit strange, but that's just how it is :)
In any case this sentence is a bit confusing, because it sounds like a command, but it's actually in the present tense, not imperative. I.e. it means you are not touching it, as a statement, not do not touch it which would be (du) rør ikke ved den.
So it seems that I am being told I must memorize sentences such as these, as there have been many rule changes over the years and it is very difficult to give a hard & fast rule now. But the "den" reasoning I do not get either. We are supposed to make a judgement call on the choice det or den when we were taught thus far for me to use det. I want to learn, but want to understand. Perhaps it will be self evident in the next lesson. I have never complained before