Why is it recommended to do a post-doc outside of the group you did your PhD in?
why do researchers often choose to do postdocs at other departments?


A few reasons:


It's fundamental, especially at the beginning of one's career, to widen one's horizon and see how other groups around the world are used to work, how they are organized, and which kind of activities and ideas they have. I know a few researchers who have never tried to have experiences outside their "home" group, and I think that they have a limited view of the academic world, and have limited research ideas.
It helps to build connections that might become useful for one's future career. 
It strengthens your curriculum. 
It helps to keep boredom away: many people is positively affected by a temporary, or less temporary, change of environment.



  one has to face the cost of adjusting to a new environments and labmates and take the risk of working with an advisor he/she doesn't have good chemistry with. 


You might be faced, instead, with meeting amazing people, expand your experiences and knowledge, and visit other cities and countries. All this while being paid.