There have been some articles lately about blood pressure drugs causing symptoms similar to celiac disease. Here's a bunch of articles about it, if you want to know more.
I see in the comments that the meds were anti-convulsants and mood stabilizers. It easily could be the case that they messed up with serotonin signaling in the gut, which either could have exacerbated a pre-existing gluten-sensitivity, or could have been the triggering event for celiac disease.
After reading this research abstract, I think a third possibility could be that you had a pre-existing gluten sensitivity or celiac disease but didn't know it, and that intolerance started causing your symptoms that led to being prescribed those meds. Maybe they were the straw that broke the camel's back, or maybe the timing was right. And then the gluten intolerance became clear.
And depending on your illness, you might find this article helpful.