In general border towns are areas that you want to move through very quickly.
I recommend NOT sleeping in border towns—choose a location that will get you to the border crossing early enough in the morning to strategically process your paperwork and that allows you ample time for any problems or complications that may arise.
Near Nogales I recommend hanging in Tuscan and moving through to Hermosillo or Guaymas after crossing.
If you cross near San Diego I recommend the La Fonda Hotel between Rosarito and Ensenada for a nice leisurely day after crossing.
For the more adventurous I recommend the surf hostel at 4 Casas about five hours further south, just before the town of Punta Colonet north of San Quintin—4 Casas overlooks a beautiful right-hand reef and is a great place to hang with a full kitchen, surfboard rentals, and restaurant for $15 per night (more info in the paid version of this guide).