Qualified immunity is the principle that an official cannot be sued for an action that isn't clearly shown to be unconstitutional. It shuts down a lawsuit before there is any fact finding as to whether or not the official was reasonably justified in their belief that their actions were constitutional.
Yes, being reasonably justified that actions were constitutional should be a valid defense. But qualified immunity isn't a defense, it's a vehicle to shunt cases out of the system before the question of defense is raised. And we already have a judicial mechanism to decide whether or not someone's actions were reasonable: pick 12 random people and ask them if they thought their actions were reasonable, aka, a jury trial. There's no need for qualified immunity.