Bariatric surgery does not cause dental problems. It's related to other poor choices including unhealthy eating, dental hygiene, or perhaps some rare, unrelated medical issue.
More often, dental health can improve after surgery for many people because overall body inflammation decreases with healthier eating and fat loss. It can be especially beneficial for people who are diabetic or pre-diabetic because diabetes negatively affects circulation in the gums and increases inflammation. In my case, my gum health got significantly better after surgery. Although I had good dental habits, after surgery my gums got healthier. It was pretty dramatic.