I wouldn't travel to a severely under-vaccinated destination now, but I'll leave it to others to decide whether it would be unethical to do that. The fact is that Tangier, where the ferries from Spain go, is not remotely one of Morocco's best destinations. The ferries do not depart from Malaga, so you have to spend time getting to the ferry port as well as time on the ferry itself. And you just end up in Tangier. There are--in normal times--non-stop flights to better Moroccan destinations (my favorites being Fes and Marrakech) from many cities in Europe, so you are not limited to visiting Morocco when you're in southern Spain.
Malaga is a very pleasant city. There's a good bit to see and do there. Much of the city is pretty flat, but it's an uphill walk to the Alcazaba; I don't know whether there's bus service available up to the Alcazaba. Since Malaga is large, I'm sure there is good urban bus service that might be helpful to you, depending on where your friend's condo is located. I'm a bit walker, so I got around Malaga's tourist attractions on foot.
Malaga is a major transportation hub for that part of the Spanish coast. Some of the towns have rail service; others are served by buses. If you want to branch out from Malaga during your week there, you should ask for advice from your friend and others who've been to the area recently, because I know a lot of the coastal towns are said to be awash in unattractive low-budget high-rise accommodations. You'd want to see towns that still have some historical character.
I believe there's bus service from Malaga to Antequera, an inland town I've never been to but which I understand has a nice historic center. Be sure the bus takes you into that area, because the Antequera train station is way out of town, I believe.
There's fast train service to the lovely city of Cordoba, but the tickets would be rather expensive unless you were able to get them at the Promo price, which usually means buying the tickets shortly after they go on sale and committing to a specific travel date and time. But you may already be planning to spend some time in Cordoba; it's definitely worth going for more than a day-trip.