The German side added the trophy to a glittering collection after completing a Bundesliga, German Cup and Champions League treble in the summer and then adding the European Super Cup - the most successful year in the club's history.
They did the damage early in Marrakech, with Dante opening the scoring after seven minutes before Thiago Alcantara doubled the advantage in the 22nd minute.
Pep Guardiola's side remained in the ascendency and contiunued to pepper Khalid Askri's goal with shots, with Shaqiri the closest to adding to the lead when his 62nd minute effort rattled the crossbar.
Raja Casablanca, surprise finalists after upsetting Atletico Mineiro in the semi-finals, had a handful of chances on the counter-attack but never managed to put Bayern under any serious pressure.
It is a third Club World Cup title for Guardiola, twice a winner with Barcelona.