Roca impressed last season despite Espanyol's relegation from LaLiga and has signed for the European champions on a five-year deal.
The 23-year-old made 121 appearances in total for Espanyol, scoring three goals.
"I am very happy. A dream come true for me," Roca told Bayern's official website. "In my opinion, Bayern is the best club in the world and has a strong tradition. I am very happy to represent the colors of this great club."
Sporting director Hasan Salihamidzic said: "We are very happy to have signed Marc Roca. He is an outstanding fit for our team both as a player and a person, and will continue to develop here with us. We are sure he will give our team great value."
Roca comes in after Bayern sold Thiago Alcantara to Premier League champions Liverpool in September.
Michael Cuisance also looked set to leave for Leeds United, but the move broke down reportedly due to complications with the Frenchman's medical. However, he has also been linked with Marseille.