‘Water quality’ is a term used in technical and professional situations.
My job is to test water quality.
After the flood, the water quality was unacceptable.
‘Quality of the water’ is just general English and might be used more informally by non-experts.