This works because the hash "is" the content/entire subtree (modulo hash collisions), so the resulting data structure has the same meaning as before.
Content/hash-addressed stores are related to referential transparency and immutability (and deep equality) in languages like Haskell, FWIW. I've always thought it's sort of beautiful how cleanly the ideas come together like that.
Similarly, we also refer to "Merkelized Abstract Syntax Trees", a way of hashing code originally proposed by Pieter Wuille and Russel O'connor(1) that will probably be added to Bitcoin's scripting system eventually.
Pretty much any data structure can have hash functions added to it to "merkelize" it, producing an authenticated data structure: http://www.cs.umd.edu/~amiller/gpads/
1) https://download.wpsoftware.net/bitcoin/wizards/2014-12-16.h...
Or maybe it's a solution for transaction scriptSig malleability? [1]