It started out as being a manga about a kid who became possessed by an ancient spirit residing in the Millennium Puzzle who fought evil games
It was originally a horror manga. In order to make the fights original, the author made the fights Shadow Games that reveal the dark nature of players.
As for why the story deviated from the original, that's what happens when an episodic type changes to a continuous storyline type. Having a bunch of quality short stories will keep readers interested for a time, but what makes readers really starve for your next chapter is a long story. Resolving a conflict doesn't make readers want to read more. Loose ends do.
In order to make a transition in this manner, you need to focus on a specific aspect. The manga could have gone a number of ways. Role playing games, live action deathtraps, game-Batman, capsule monsters, chinese dragon cards. They settled on the Duel Monsters because apparently the readers really liked the card game. Duel Monsters was originally only supposed to appear twice: both of them duels with Kaiba in the original series. But the author decided to go all in with Duelist Kingdom and the rest is history.
Since the premise became based on a card game, having guns and panty shots in a trading card game based anime would be a recipe for utter disaster since they would clearly detract from the story. And since the friendship theme was already there it made sense to market to kids.
Original source material for the story of Yugioh's growth will be found in the forewords and chapter notes of the manga volumes. I sourced this answer from https://en.wikipedia.org/wiki/Yu-Gi-Oh!