Because it qualifies sculpture. It's an 18-foot sculpture. I'd say that "18-foot tall" is an adjectival phrase.
However, the sculpture measures 18 feet. That's a noun, perhaps acting as an adjective in sentence one.
However you parse them, the phrasing is correct.
Why, how would you label them?