The types aren't just arbitrary terms: They're forms of energy, each with separate and unique effects. Pokemon have the ability to channel and use these different types of energy. Think of Ghost, Dragon, Fairy, etc as just being different elements, like Water is an element, Fire is an element, etc.
Pokemon that channel a great deal of a particular type of energy, and have a natural affinity for it are associated with that type, because it changes them. Changes what hurts them.
Basically, think of Ghost less as a type, and more like 'supernatural energy'. Pokemon that channel a lot of supernatural energy are Ghost Pokemon. Attacks that use supernatural energy are Ghost type attacks, and these supernatural attacks disrupt other Ghosts and really bother Psychics, while slightly dissipating against darkness. You follow?