This is my interpretation, but I would love to see everyone else's interpretations. Also note that this answer attempts to assess the logic of fantasy. Obviously, there's no universally-accepted logic in fantasy and I'm probably one of the less-competent people to answer this as I seldom immerse myself in fantasy, but I'll give it a go.
The general consensus for this match-up's justification is what sumwun said: the only thing that could beat a dragon is another dragon. The majority of the other types are elements that exist in the real world (bar Ghost, Fairy and Psychic to an extent). A dragon, in all its invisible reverie, can be imagined to have immense power that could only really be matched by one of its kind (or, as Gen VI demonstrates, could be a fairy too). This concept can justify Ghost's weakness to itself, but not Fairy. I believe Fairy exempts itself from this concept because fairies are often a representation of collaboration and to an extent, goodness. They might not always have good morals but fairies are often seen working with each other instead of against because of their rather inconvenient size. I also personally exempt Psychic as a 'fantasy type' altogether because of its weakness to three very human fears: bugs, ghosts and the dark.
Another interesting justification of this match-up is that immeasurable power has the potential to be a burden to one's self. This answer justifies Ghost's weakness to itself as the eternal self-torment one would experience in the afterlife. If you were to die and live as a ghost, you might exist thinking 'what would/should/could have been', or if you remain trapped on earth, you'll see the world move on without you, moving on from you, forgetting you... I personally rebut these interpretations as this type matchup involves a Ghost hurting another Ghost, so self-torment seems unlikely, but it's interesting to apply this concept to the burden of holding too much power. History can tell endless stories of figures who burden themselves with their own power - dragons are usually more powerful than humans physically, but depending on your vision, a dragon might have clear and dangerous intentions that they may regret if they went through with them. It's certainly an interesting perspective to consider.
Obviously, the primary reason Game Freak made Dragon weak to itself was for type-balancing reasons - Game Freak might not have thought more than that. But I hope I gave some insight into this Game Freak logic.
Hope I helped. :)
Source: Above link, but I did a lot of cross-referencing and I've generally looked up on this a bit in the past.