The text plays on the double meaning of the word 'bill'. In the context of birds, a 'bill' refers to their beak, while in the context of a lawyer, a 'bill' refers to an invoice for services rendered. The punchline humorously suggests that a lawyer should be able to do something absurd with their 'bill', similar to the physical impossibility for a goose or duck.
Q : What can a goose do , a duck can ' t , and a lawyer should ? A : Stick his bill up his ass