This was by design. The SI defined the unit of mass grams in terms of the units of distance
The SI system of measurements were designed to make sense and to be accurately replicated. The meter was defined as a fraction of the latitude of the earth. This created a standard unit of distance that could be replicated. The unit of volume was based on the unit of distance
The unit of mass was to be based on the unit of volume. the mass of 1 ml of water at 0 degrees C and 1 atmosphere of pressure would be the standard unit of mass 1 gram.
So by definition 1 ml of water has a mass of 1 gram. This makes the density of water