Given that you are flying into and out of Berlin with the same airline I would strongly recommend you ask them if a visa will be required. Not only is this likely to get you the best/correct answer, it will reduce any issues with them checking your visa when boarding in Canada if one is required.
There are two airports in Berlin (plus a third being built to replace the first two!), but I presume you're referring to Berlin Tegel (TXL).
Tegel has a number of terminals which are configured differently, with terminals A and C being the main terminals for international flights.
Terminal A, instead of having a single passport control/customs area as most airports have, has individual passport control/customs at each gate. As a result, it's impossible to get from one gate to another "airside", and thus you will need to pass though passport control regardless of where you are connecting to - and for that you will need a Visa.
Terminal C is a more typical layout, with a transit area available for most connecting passengers which does not require passing through passport control. Passport holders for many (but not all) countries are able to pass through this transit area without obtaining a visa, and that includes citizens of Morocco.
So in short, if your airline uses Terminal A you will need a visa. If your airline uses Terminal C, you likely will not. But regardless - check with the airline to find out their recommendations and go with what they say.