Would you tell me what BUT means here?
I think it means BUT FOR, or OTHER THAN.
I have no choice but to listen to the doctor.
You cannot use "but for" instead of "but" in this sentence, but "other than" is fine. That said, the construct "no choice but to ..." is much more common than "no choice other than to ...".
If there is any question about the meaning of the sentence, another paraphrase is "To listen to the doctor is my only choice", but you probably would not hear this in casual speech.