Kirk nagged (blackmailed?) Admiral Nogura to get command of the Enterprise, then waltzed on board to yank the captain's chair out from under Decker. Decker is then given the scraps of being kicked down to XO while losing a bit of braid. That left Decker more or less in line with the First Officer, just easier to ignore. Not that he wasn't easy to ignore in the first place.
Kirk saw an opportunity to get the Grey Lady back and no one was going to stand in his way. Who knows how many favours he called in to make it work, but by damn he'd be her captain again. Age, treachery, and a questionable hair weave will always triumph over youth and skill.