How did "east-west" come to mean "thing"? One popular theory: in the Tang Dynasty, markets were in the east and west districts of Chang'an. "Going east and west" meant going shopping — and what you brought back were your 东西.
When 东西 means "thing/stuff," the 西 is pronounced with a neutral tone (dōngxi, not dōngxī). When it means the literal directions "east and west," both syllables keep their full tones (dōngxī).
usage
Calling a person 东西 is an insult — like calling someone "a piece of work" in English. 你是什么东西? ("What kind of thing are you?") is very rude. But 好东西 can affectionately mean "you rascal."
culture
The Tang Dynasty capital Chang'an (modern Xi'an) had its main markets in the East Market (东市) and West Market (西市). This commercial geography likely influenced how 东西 became the word for "things."