How to tactfully refuse to be listed as a co-author
Well, there were a lot of mistaken decisions here, including by the journal to list your name.
To answer your title question, you should have, before the paper was submitted, told the group you didn't want to be involved, whether you said something like "I disagree with the conclusions of this paper, and don't want to be an author," or a white lie like "I don't feel I contributed enough to be an author."
You can also offer to be happy to be acknowledged; I find this is an option for authors who do not wish to hide an unwilling collaborator's contribution without making them co-responsible for the publication. This can soften the blow of disagreement without requiring to lie. - Captain Emacs
Upon getting the form, you shouldn't have silently declined, you should have talked with the other authors and informed the journal you were included accidentally. With everyone's consent, they would have taken you off.
You should have asked the co-authors not to be included up front. Leaving it until the journal asks to confirm your authorship is a lot more rude to your co-authors than just communicating with them. It makes them look dishonest or disorganized to the journal if you later ask to not be included.
However, if you got to the point you did, you should have explicitly asked to be removed from the list rather than hoping your non-response would give you the same result.
A colleague and I once had to deal with a very similar situation: after telling our then-boss that we disagreed with his interpretations, he went ahead and presented them at a conference, listing us as co-authors.
In that case, there was no paperwork to confirm co-authorship permission. We ended up sending a letter along the following lines:
We note that we have been listed as co-authors for presentation X and poster Y. We feel that our involvement in this work does not meet the requirements for listing as co-authors, and therefore we request that the proceedings be amended not to list us.
In your case, you should also note that you didn't submit the paperwork to be listed as a co-author.
If you want to soothe your colleagues' feelings, you might also suggest that a "with thanks to..." would be appropriate in place of a co-author credit. This allows them to acknowledge your contribution to the work, without implying that you endorse the paper.
Lesson for next time: people don't always check the paperwork closely, so if you don't want to be listed as a co-author, it's best to say so explicitly.
If they had checked the paperwork, the most likely outcome here is not that they'd have gone ahead and published without your name included. Rather, they'd have told you and your colleagues that they couldn't publish until you'd submitted the form, so this wouldn't have escaped the need to have that uncomfortable conversation with them.