Parshat Matos-Masei

What motivated Reuven and Gad to make their controversial request to settle outside the Land of Israel? Why did Moshe give them permission to do so?