As David and his men escaped King Saul and his army, David went to Ahimelech the priest, but Ahimelech did not know that Saul was after David, although it would not have mattered, Ahimelech still supported David, but would not support a rebellion.
Anyway, a man was present who reported to Saul the meeting between Ahimelech and David,
“Then answered Doeg the Edomite, who was set over the servants of Saul, and said, ‘I saw the son of Jesse going to Nob, to Ahimelech the son of Ahitub. And he inquired of the LORD for him, gave him provisions, and gave him the sword of Goliath the Philistine’” (1Samuel 22:9-10).
Truly, Ahimelech did those things, but not to overthrow the kingdom of Saul and not to help David overthrow the kingdom, although Saul believed that was what David wanted to do. Therefore, with the context of rebellion, the true report of Ahimelech appeared to be an evil thing.
Sometimes you will be in that situation. You will do the right thing, but someone will interpret it or put it into a context to make it look as though you have done evil. Do not despair, but know that it has happened before, and God knows the truth.