Swimming is good exercise.
Swimming is a good exercise.
I checked all the major dictionaries and they say that it is uncountable when it means (physical or mental activity that you do to stay healthy or become stronger)
I have seen the following examples - Swimming is great exercise. (Longman Dictionary)
Swimming is great exercise. (Oxford Advanced Learner's Dictionary)
Cycling to work is great exercise. (Cambridge Advanced Learner's Dictionary)
None of them have used "a" before exercise because they say that it is uncounted here. They also say that exercise can be a countable noun when it means a set of movements. What I think is that swimming is not a set of movements and therefore 'a' is not placed before exercise.
Do you think that we can use 'a' in the sentence "Swimming is a great exercise"?