Pineapples do sometimes cause bloating in some people especially if they have problems with digestion.
Pineapples contain bromelain which is an enzyme that helps support protein digestion but sometimes can cause digestion issues in some people.
That bromelain enzyme is what sometimes causes bloating in some people so if the pineapple causes bloating then you might have to stop eating it if you don't like the bloating.
Or you should slow down on the amount of pineapple that you're eating because it can cause bloating in some people.
I sometimes get some bloating when eating pineapples especially if I do eat too much pineapples.
Pineapples are very healthy for you tough too and can help prevent some diseases and boost your bodies immune system.