He was Omnipotent and bored? There's only so much to do as the Spectre when you're not giving out brutal vengence and vague advice. :p
But seriously, there has never been any indiction AFAIK that hal gave up his Spectre memories. And for all we know, hal could have seen a Leaguer interacting with Oracle over communicator, gotten curious, and found out.
Or, more simply now that I think about it, Barbara may have chosen to reveal her identity to one of the two most powerful law enforcement officials on earth. He could have learned about Tim and Jim through conversation with Bruce.
I guess my point is that I don't think it's that big of a deal that two of the major players know each other's identities. But, as I must go to sleep now, we shall have to agree to disagree.