Now that I have explained the background, I will do my best to explain the grammar. Usually, when you say that you have "a right to", what follows is a verb - a right to do something. A right to vote. A right to practice a religion. "A right to an attorney" essentially means the "right to talk to an attorney." (Other verbs you could use would be, to consult with an attorney or be represented by an attorney.) One way you can think of this phrase is that the part "talk to" is omitted because it is implied. It is so obvious that it does not need to be said. I should note that some "Miranda warnings" actually are "You have the right to talk to an attorney" and not just "You have the right to an attorney."
It is also common, however, when referring to higher concepts, to say that a person has "a right to" some thing. A right to freedom. A right to life. In this sense, in the US, you have the right to an attorney. "An attorney" here is used to mean not just a specific, actual person but the concept of a tool of the legal justice system with the sole purpose of assisting you. If you can think about it that way, it may be better not to include the verb "to talk" or another verb, because the right to an attorney goes beyond just talking to an attorney. If you say that you have the "right to an attorney" you have the right, not just to talk to an attorney, but also to consult with an attorney, to be assisted by an attorney, to be represented by an attorney, to have an attorney present when being questioned, etc.
That was probably a much longer explanation that you wanted, but I hope it was helpful to you. If it did not make sense, or you need more clarification, let me know. It was a really intelligent, thoughtful question! Good luck!