I do not think I would go out alone in Casablanca - or anywhere in Morocco or anywhere in Northern Africa. But that is just me. I have been to tangiers and it was pretty scary at first, but also exciting.
Genoa - it is a pretty modern and industrialized city. I can't imagine walking off the ship and not taking a tour. In fact, I did that once and did not find anything I wanted to see. I would take a ship's tour.
Malaga - the real destination is Seville, correct? You may be able to get a train but on a tour you see more and you get a guide. I would recommend taking a tour in all three of them.