As far as ego: fairly or unfairly, Shatner decided Kirk, Spock and McCoy were the stars (which by their credits, they were) and that's where he put his focus. What was he supposed to do? If he had written it all from say, Sulu's perspective, would people have complimented or complained about it?
Shatner didn't 'decide it' GR did; and hell when it came to a head between Shatner and Nimoy, they went to GR's office, asked, and (after some attempts to wrangle out a non-answer because he knew no matter what was said, someone would be upset); GR stated - "Shatner".
As others have said, over the years, the "big 4" got swelled heads from meeting fans at conventions who idolized them. Most of the 'big 4' had worked TV in that era before; so they knew how the 'game' was played - and that the 'star' got lead billing.
I think it's honestly true that Shatner didn't think much of the 'regular extas'; but to be fair, most other stars didn't either. As for Dohan, I think he just didn't like Shatner's attitude on set (and that type of attitude was comon); and later over the years, Dohan (for whatever reason) built up a lot of resentment toward Shatner.
As for the rest of them, I think they tell the stories because it sells 'behind the scenes' books, and gives them something interesting to say at conventions when fans ask about some minute detail they can't recall. Hell, Nichelle Nichols has three different versions of her "Meeting with Dr. King" that convinced her to stay with the show after season one, that to this day, she tells interchangeably.
As for Shatner 'stealing lines'; hell he did that to Nimoy on
The Doomsday Machine if William Windom's recollection of his days spent working on that episode are to be believed (and I do, as he wasn't one to restructre his memories like a lot of guest stars seemed to do whe n the show got popular and in later years they were asked to recount their on set experiences.) He honestly stated that no one on the set was particularly friendly with each other, they were all working actors and did the job (and Shatner amd Nimoy were both line counting; with Skatner wanting re-writes for more dialogue as he was the Star).