Nadal, the gold medal holder in the men's singles from Beijing, was forced to pull out of the Games on Thursday after failing to recover from a knee problem.
Los Angeles Lakers centre Gasol is one of the country's most recognised sportsmen and helped Spain win silver in Beijing four years ago, when they lost in the final to the United States.
"I am very happy to be Spain's flag bearer. It's one of the best moments of my career. Thanks to the sports federations and COE," Gasol said on his Twitter account.
One of the first people to congratulate the Barcelona-born 32-year-old was Nadal.
"Congratulations. I am very pleased you are the flag bearer! You are a reference and a great example to everyone! Enjoy it! You deserve it!" the French Open champion said on his Twitter account.
NBA player Gasol, who's brother Marc is also in the Olympic team, has been at the heart of a glorious few years for Spanish basketball helping them to win gold at the world championships in 2006 and two European titles in 2009 and 2011.
Sailing duo Iker Martinez and Xabi Fernandez had been in the running as well but they ruled themselves out so not to upset preparations for the July 27-Aug. 12 Games