You do not have to order alcohol. Just order a Coke or a bottle of water. (Not a glass of water)
However, do not imagine that all of the restaurants in Andalucia offer a free tapa.
I think this is more common in Granada than in other cities. I've only seen it there, and the free tapa was not always one I would select from the menu, given a choice. Maybe a slice of chorizo, or a spoonful of rice with beans, at traditional bars like BODEGAS CASTANEDA.
But what I have found in Andalucia, and elsewhere in Spain, is that you will often be presented with a complimentary "entrante" when you are waiting for your meal at a restaurant. That's almost universal. Also, I'm usually offered a complimentary "chupito," or shot glass of liqueur, after my meal.
I've never been offered a free tapa in Madrid, although there may be places that offer them. Again, I'd expect that if offered, the free bites would be the most simple and inexpensive type..