Morocco has a few bus companies, but a good one that I used multiple times is CTM. It has routes that criss-cross the country and reasonable prices. I paid less than $10 USD for a nine-hour overnight trip. There are multiple overnight bus options in addition to the regularly scheduled day trips. You can find the CTM station by asking "Fin la gare CTM?" in Moroccan darija.
The most popular train company is ONCF and it has routes that pass through the major cities of Morocco. Transportation on the trains is priced reasonably. A trip from Fez to Casablanca will take about six hours, as will a trip from Casablanca to Tanger. Most tickets will cost around $10 USD, but longer trips can be around $20 USD.
There are a few different types of taxis that go around in Morocco. The first is petit taxi, which is for 1-3 passengers and is used for short distances around a city. Each city's taxi is a different color. As a point of reference, I took a petit taxi for 15 minutes in Tanger and paid 7 dirhams, which is about 7 cents in USD. The second type is grand taxi, which fits 6 passengers going in the same general direction. They split the cost between them. This can be used in big cities as well as for transport from one city to another. For reference, a trip to Chefchaouen from Tanger cost 60 dirhams ($6 USD) each. It lasted an hour, and there were only five people in the car. Grand taxi prices can be difficult to negotiate if you don't speak Moroccan darija or at least French, since the price is decided and then split between all passengers. If the car only has a few passengers, the drive will wait for it to fill up - so if you want to go somewhere in a hurry but you're in a quiet town, you might be waiting for a while and in this case a petit taxi might be a better option. Lastly, if you want to go from one city to another, there will be a taxi stand in the city you're in that is specifically for long distance service.