That is called an Air Gap and used to protect the situation that if your sink clogged, and with your dishwasher connected to such drain, this device provides a air gap to keep this from siphoning back into the dishwasher which will contaminate the water inside of unit.
This is code nearly in all states and would just advise replacing this item with new one to update looks.