Each of the three aspects of the four material elements performs its own function. Gratification stimulates desire; drawbacks lead to disillusionment, while escape opens the possibility of freedom.
If the material elements were solely painful, beings would not get attached. If they were solely pleasurable, it would be impossible to become detached.