Evolution doesn’t work like that, it’s not a force with goals except reproductive fitness. In this case our society compensates for their issues, and their reproductive fitness is maintained. In the wild they would disproportionately starve and die, and that would also be a valid evolutionary response. It may also be thst gluten intolerance doesn’t particularly matter to rates of reproduction before it kills you, outside of civilization. If what kills you does so after you pass your genes along, evolution doesn’t even notice.
There might be some hidden benefit too, such as with sickle cell and malaria, or more commonly the defective genes are part and parcel of a critical system.