... when we asked at the surgery they said that since I'm married to a british citizen that makes me automatically entitled to it for free.
This is essentially correct, and would be true as far as most NHS employees are likely to know. People who are married to British citizens
and have legal status in the UK (ie spousal visas or FLR(M)s) are automatically entitled to free-at-point-of-service care. However, since you have only visitor status, your marital situation isn't relevant in terms of NHS. Visitors, of any kind, will receive care but have to pay for it. NHS employees are not immigration experts, and it's not their job to determine whether someone gets free care or not. They weren't trying to mislead you, they just didn't have the relevant background knowledge.
It is crucial to consider the source when you are taking advice about something as delicate as immigration. Most people don't have a clue. Read what the newspapers have to say about immigrants, and you'll see what I mean. Always,
always go to a professional who specialises in your particular situation. You can possibly sort this all out, perhaps not entirely to your satisfaction, but it doesn't have to be a calamity IF you find the right person to advise you.