If you want public health insurance, you will need to pay taxes in Spain. You could get private insurance through a number of different companies, though this will likely be much more expensive.
As far as being above board, it really depends on how long you are planning to stay, and whether or not you are a permanent resident.