But what information does he use to deduce that 1 and 2 must have a beer?
If all 3 enter into the joke in the "not-knowing" state [ 0 0 0 ]
then through the dialogue, information must be imparted to make it [ 0 0 1 ]
but they say "I don't know"
which afaict doesn't give 3 any information to make a deduction.
(not to over-intellectualize your joke or anything)