But the Joker was obviously psychotic, deranged, demented and delusional, and functioned quite fine as a criminal, so what's the difference?
Umm... he was a criminal. A psychotic criminal. All the traits you mentioned are pretty much essential for the Joker's particular brand of criminality, hence he's able to function as a deranged criminal, because he's deranged. If Batman had all those issues, he would not be able to function as a crimefighter on pretty much any level. There's the difference.