joker never wanted to know who batman is. He tells him near the beginning of the scene "I was testing you, and you didn't disappoint."
Joker does but not in the way, say the Riddler does-- to feel smart or feel like he figured it out. Or how someone like the mob or Black Mask would-- to get leverage over him to bargain/threaten him or to defeat him
Joker at the beginning of the movie wants to know who Batman is in order to understand him. And in understanding him to know how to best manipulate, hurt and make him "fall.'
Later in the movie when he is no longer interested in who Batman is it is because of Joker's own mistaken belief that he does "understand" Batman, thus who he is without the mask becomes unimportant and boring (whoever he is, he couldn't possibly be as interesting as who he really is... ie the Batman). If Joker did know Batman was Bruce Wayne it would BLOW HIS MIND because a man like that who is truly altruistic cannot exist in Joker's world. It would drive him even more insane than he already is.
Batman to the Joker is a man who deals with his pain through violence and by inflicting pain in others, as the Joker does. He may pretend he does it for "the common good" but in reality he's only does because he is someone who NEEDS the public's sanction and acceptance. Basically to Joker there's 2 parts of the Batman... 1)someone who likes to cause pain 2(someone who cant accept that he is someone who likes to cause pain and therefore has to give himself the illusion that it's "in the public's interest" and therefore justified
What the Joker says to the Batman is to try to get him to break down that 2nd mental block in his head (which Joker believes is artificial). He thinks that IF the city WILL turn on him, that will strip Batman of his self-illusion of doing it for a good purpose and will allow him to fully embrace chaos like the Joker has. That's why he's telling the Batman the people of the city will turn on him when push comes to shove
This is ALSO why Joker cannot anticipate Batman taking the fall for Harvey. In the Joker's mind, Batman NEEDS the illusion of public acceptance and cant afford to give that up psychologically. Batman is this sick psycho who needs to inflict pain but cant bear that truth so he needs the city to look up to him as a hero. (which in a way is genius on the part of the Joker, he has the insight to understand that Batman's goal is to be a SYMBOL... although he simply dismisses that again as an example of hypocrisy)
What Joker doesn't know and can never know is that Batman comes from an entirely different place and to him it really doesn't matter if the people think he's evil as long as there's someone even GOODeRRRR than him in the publics conscience eg I believe in Harvey Dent