Other reason that's not talked enough is: The author is just in the closet, and they try to pretend they're writing genderbender only because for the views.
Other than that, the author probably doesn't have any preference over any gender for writing a protagonist, but some guys want to feel this 'relatability', so they create a girl but still with a guy's mind. You always see this in isekai. Being reincarnated/transmigrated doesn't really matter, as long as you can check 'modern guy I can relate in medieval fantasy world' in the list, even though such background become quickly forgotten for the whole story. The logic also applies in some genderbender stories.