I’d expect the SQLite filesize is not directly related to its data. It might depend how and in which order the data has been added to the database. Perhaps after vacuum there are still holes in the file.
But anyway, if the data otherwise is valid it’s not a Joplin issue, but an SQLite one, and it’s most likely not a bug.