1. Bran isn't exactly prime material - he is the youngest surviving Stark kid and is about 15 years old. He's just as new to being a 'high lord' as Gendry, plus he's younger, disabled and just plain weird.
2. He doesn't abdicate anything by bending the knee, especially when that queen dies. Jon represented house Stark and bent the knee, but that doesn't mean the Starks abdicated anything. Cersei, for example, had zero claim on the throne as she was never in the line of succession, but that didn't stop her from being named Queen. The Starks and the Greyjoys allied with the Targaryens in taking down the Lannister on the throne, but once the head Targaryen has died, there's nothing to stop anyone from deciding whether or not to put a Baratheon back on the throne. Considering Robert's reign was relatively peaceful, both the lords and the people would welcome his son, bastard or not.
3. Bran is the Three Eyed Raven who can't be lord of anything. The key to being a good King, as proven in the final episode, is who the King surrounds himself with. Bran pretty much made it clear that he's not really going to run anything and he's leaving it to the small council.
With the way they left things at the end, just about anyone could have been named King since it was no longer being decided by succession or blood but by who the people and the lords would accept. Gendry would be more accepted by the people as a Baratheon, and just as able to rule (probably moreso since he'll probably spend more time in the here-and-now than Bran
) Keep the same small council, add Bran as his Master of Whispers and long live Gendry the Smith, first of his name, leader of the six kingdoms, etc.