Associations don't imply causations. We don't know if gingivitis causes heart disease, nor do we know if heart disease causes gingivitis. Or maybe each has a minimal direct effect on the other (I'd never say none at all).
Likely, individuals that have/do things that prevent gingivitis, like affording a dentist, also have/do things that prevent heart disease, like affording blood pressure medications.