The basic problem appears to be that the photo, at least the top part where the two shelves are, is grossly underexposed. That means the signal to noise ratio is already quite low.
Look closely at the left picture and you will see some of the grid pattern evident. This is probably some repetitive noise in your sensor. Normally you wouldn't see it, but the actual image information is so small relative to the noise floor that the noise appears visibly in the picture.
The reason you see it more in the right picture is because someone attempted to brighten the picture a little or otherwise get more detail in the dark areas when there was little to be had. This amplified the grid noise to make it more apparent, but it was there all along.
The solution is to use proper exposure. There is basically nothing you can do to recover from low signal to noise ratio unless you are willing to give up spacial resolution. Put another way, the information to make a good picture simply isn't present in the original.