Why do airliners still have a switch for the non-smoking sign?
Smoking was outright banned on flights in the US in 1998/2000 which was in reality not all that long ago. It should be noted that smoking on domestic flights under 2 hours was banned in 1988 and under 6 hours in 1990. With that in mind we must remember that there are plenty of planes that are still in service and older than that, many were designed long before that time as well. In the view of the airlines its simply cheaper to leave the lights and switches there than put in a new interior panel in many cases. 

Also as mentioned in the comments planes are built for the global aircraft market and there are still countries that allow smoking on flights. This question is similar and has some good info as well.

But here in the US the main reason is because the FAA mandates the signs, 

For charter (135) operations 


  § 135.127 Passenger information requirements and smoking prohibitions.
  
  (a) No person may conduct a scheduled flight on which smoking is
  prohibited by part 252 of this title unless the “No Smoking” passenger
  information signs are lighted during the entire flight, or one or more
  “No Smoking” placards meeting the requirements of § 25.1541 of this
  chapter are posted during the entire flight. If both the lighted signs
  and the placards are used, the signs must remain lighted during the
  entire flight segment.


For scheduled commercial (121) operations 


  § 121.317 Passenger information requirements, smoking prohibitions,
  and additional seat belt requirements. 
  
  ... 
  
  (c) No person may operate
  an airplane on a flight on which smoking is prohibited by part 252 of
  this title unless either the “No Smoking” passenger information signs
  are lighted during the entire flight, or one or more “No Smoking”
  placards meeting the requirements of § 25.1541 of this chapter are
  posted during the entire flight segment. If both the lighted signs and
  the placards are used, the signs must remain lighted during the entire
  flight segment.


The reason they are not lighted the entire time most likely stems from history. Since there is a switch to turn them on chances are there is a check list item to flip the switch. You will most likely see them go on and off when the pilot hits that item on the pre flight checklist that may occur at the gate or on the taxiway heading out for take off. 

The Piper Archer I fly still has ash trays (there is even one in the pilots seat arm rest)...