Is the discomfort from gas or from constipation? Two different things. If you feel discomfort soon after you eat greens, it's probably gas. Constipation is more of a larger-picture problem relating to your diet overall.
Lots of greens can be gassy, but spinach is generally not one of them, and also contains magnesium which helps clean you out.