There are indeed two syntactic readings of this structure, which can be distinguished by phraseology (and helped by punctuation).
In the first, "as" means "like" or more specifically "according to the manner in which".
In the second, "as" means "because" or more specifically "in view of the fact that".
In your first example, it must be the first reading, since it wouldn't make sense to say you didn't close the door because they told you to.
So it means: You told me to close the door and I didn't.
However, it could also be the case that you were told the exact manner in which you should close the door. Then the sentence could mean: I closed the door, but not in the way you told me to. (We would write it without a comma in this case.)
In your second example, it must be the "because" reading, as you suggested. Otherwise the negatives pile up to absurdity.