Because it's a neutral color that doesn't strain the eye and allows for good legibility when using black or white fonts, and its neutrality aids to place the focus on the real content window. 

The shade of gray will vary depending on the software, of course, ranging from a light gray to a very dark gray.

As for studies, [here][1] you can see why to use gray and its meaning
[![enter image description here][2]][2]

Additionally, take a look to [**Applying Color Theory to Digital Displays**][4], and [**this question**][3] here on UX.SE


  [1]: https://books.google.com.ar/books?id=xMJOm4ppCkYC&pg=PT202&lpg=PT202&dq=gray%20background%20for%20software&source=bl&ots=-n_OkPC-ey&sig=rNu2xbDzYQm469GmpnFXVH6ZzWo&hl=en&sa=X&ved=0ahUKEwjcj_2d1ZvNAhXTnJAKHWpKCcIQ6AEIUjAJ#v=onepage&q=gray%20background%20for%20software&f=false
  [2]: https://i.sstatic.net/mF4aZ.jpg
  [3]: http://ux.stackexchange.com/questions/8153/what-are-the-negative-and-positive-aspects-of-dark-color-scheme
  [4]: http://www.uxmatters.com/mt/archives/2007/01/applying-color-theory-to-digital-displays.php