The many widespread and massive evil acts that god commits in the Bible (the story of Joshua being one) should logically undercut any religious belief in such a god. But the desire to believe is so ingrained in some people that they are willing to abandon the logic and evidence that they use in other areas of their lives in order to maintain the things they were indoctrinated with as children.
The best defense against charges of an evil god would be to concede that the Bible is pretty much entirely fiction. This should be easy to do since the evidence against the historicity of almost everything in the Bible is so overwhelming that one has to suspend all critical faculties to retain any credence. But of course religious people cannot do that. Believers have to cling to the historicity of the Bible, at least in its basic storyline and the main events, because they have nothing else.