That is an old pressure switch. Why it is there is anyone's guess. If there was ever a slide on the pool it might have been the water supply port that just needed to be plugged and an old switch was handy. I have seen many DIY projects by owners or service people that will use a pressure switch to activate a small water feature pump, or the like, with the proper circuitry. It may have been used for a chemical dispenser instead of a flow switch. Since it is not being used and is rusting, it will eventually start to leak. Replace it with 1/4" plastic, nylon, or brass pipe plug to be safe