Tangier has always had a good selection of accommodations, and as some hotels get a bit outdated, others are built or refurbished. Most accommodations are outside the city's small, walled medina, as only recently has there been any interest in staying there. That said, there are three gems that I recommend below.
Heading up to the medina from the port entrance, there is a line of pensiones along rue Salah Eddine al Ayoubi, but my preferences are mainly on rue El Antaki, only .5km (1/3 mile) farther along but an altogether more pleasant and quieter street.
Hotels can fill up quickly during the day in Tangier, as both travelers and Moroccans arrive in the city either on their way to or from Spain. If possible, reserve your accommodation before your arrival, especially during high season.