There is nothing stopping you from marrying as long as you have all the required documents that you need to bring with you, have the money to get there and stay long enough to get everything in order (it takes a few weeks in Morocco or so I have heard), money for the certificate of no impediment, any translations/notarizations you might need, and the money to pay for the official ceremony, celebration party, etc...
However, you need understand and consider logically what you will be undertaking in terms of sponsoring your husband and determine if you are in a position to do so.
The issues will be when you get back; You will need to have the sponsorship money ($1040) plus there are a bunch of other associated costs that you will have to figure out between the two of you. Your husband will need to have a medical done which costs a few hundred dollars and get his police check done and send it to you, there will be translation fees if applicable, courier, etc..
Next; will you be eligible to sponsor him? If you are a student you will have to have a good explanation of how you will have the resources to support him when he gets there since you are not working. You will have to submit the previous years tax return/notice of assessment and proof of income.
Are you independently wealthy, do you have an ample amount of savings, or will your parent/s be supporting you both financially until you become employed? If your parents will be helping you will need proof of such.
You will need to provide solid proof of a genuine ongoing relationship; plane tickets/proof of visits (fyi if you met for the first time in person, became engaged, and got married all on the same trip, you will likely be denied), pictures before and after marriage, wedding pictures, pictures with family, chat convos, screenshots, phone bills, acknowledgement from your family, etc... You will need to address and explain any potential "red flags" which could be but is not limited to; different religion, significant age gap, if no one from your side was able to attend your wedding, etc...
See the application requirements/guide/document checklist and there are also a lot of threads here discussing what/how much proof you should provide.
If you are approved to sponsor and your application is not rejected along the way on any other grounds, your husband will undoubtedly have to attend an interview where he will be scrutinized and have to satisfy them that it is a genuine relationship and not marriage fraud before a decision is made. This is the norm for Morocco and its not easy.
If everything is approved there will be the matter of a plane ticket for him to get to Canada. Once he lands, you are responsible for him financially for the next three years. You will need to provide medical insurance coverage for the first three months til ohip kicks in, as well as ongoing shelter, food, clothing, etc...Hopefully it wont take him long to get on his feet and find work so he will be able to share the expenses with you.
Information is here regarding documents and requirements for a Canadian getting married in Morocco: http://www.canadainternational.gc.ca/morocco-maroc/consular_services_consulaires/marriage-mariage.aspx?lang=eng
Anyone feel free to add if I have left anything out or got anything wrong
