In some cases, it is merely a budgetary reason. Low budget horror can spend more money on special FX if it can limit the locations they have to film in. The idea of a group being trapped also creates a lot of narrative avenues for horror. In addition, at this point it has become a tradition that many storytellers use because it is mimics some of the classics of the genre, from Night of the Living Dead (1968) to The Haunting (1963).
And of course, horror movies like Cabin in the Woods (2011) use this trope and spin it on its head.