Hi,
I ve spent a couple of years in Morocco, and i ve been to all the places that you want to go to, by car.
Cars are quite cheap to rent, you can get a basic car (Dacia Logan for example) from 20€ per day. I used to rent them out for that price to tourists. You d better take a local agency, they re cheaper, and i feel it s nicer to go through them than through some big international company. Since you are renting for a long time (judged by the amount of kms you gonna travel) don t pay more than 20 €, or 200 to 220 Dirham, per day. They will act like you are insulting them when you mention that price, and might even get a bit angry, but that is all show. With a bit of humor (mention you ll go hungry if you pay more, you have many children that are expensive etc. for example) and persistance you ll get it for that price.
There is nothing dangerous about driving Morocco, if you take it easy. Many many retired people drive all through the country in their huge campervans, they re 70 years old and drive wherever they want without trouble.
The road from Rabat to Casablanca/Marrakech is a tollroad that you can easily drive at night. This is the only real good road though, in the rest of the country is better not to drive at night, since donkeycars, bikes and mopeds dont have lights, and you dont wanna hit those.
When you come of the boat, expect some hassle. To clear customs, bargain with rental agency etc. will take some time, you might wanna consider spending your first night in Rabat.
Where ever parking could be considered dodgy, there are parking guards. They guard your car for 1-2 dirham, pay when you return, mostly. Overnight is usually 10 dirham, up to 30 in the cities. Car theft is not a problem at all in Morocco, hardly ever happens, there are police roadblocks everywhere. Europe is a lot more dodgy for those things. The only thing you need to think of when parking at an unguarded spot is to take valuables with you, coz they do smash windows when they know there is no guard.
To really enjoy what Morocco has to offer, go with the car. You ll see a lot more, and you ll be a lot more free. Public transportation is good with the companies CTM and Supratours, between the big cities. But then you d have to take loads of taxis to see things and find hotels, or pay for guided tours.
Sometimes the police will stop you when you drive. That might be because you broke a rule, or just because they want to chat, and see if they can get some money/presents. If you speed, it costs between 200 and 400 dirham. You can always talk the police down to paying between 50 and 100 dirham for a real mistake. Just say you dont need the paper, and you ll pay them some cash. Keep small bills handy for that, dont let them see a big wad of cash, coz they they will demand 400 dirham.If they are just fishing for money, just talk and laugh, it could turn out to be quite a fun conversation, and they ll forget about the money...
All in all Morocco is great for travel by car.