My MOSFET operated solenoid circuit destroys my Arduino inputs
Your valve is rated at 500mA at 12V.  If you supply 16V it will draw somewhat more than 500mA.  Assuming it is a resistance, it will draw 667mA.

The absolute maximum current for the MOSFET you used is 500mA continuous.  Anything above absolute maximum ratings may destroy the device.  This is probably why you are seeing reliability problems.

There is no guaranteed failure mode for MOSFETs, so I'm not surprised that it would fail in such a way to damage the Arduino outputs.

As Jason mentioned in the linked answer, BS170 is a poor choice of MOSFET. You need a better one.  Choose one in a TO-220 case that is rated at several amps.  You also need to make sure the Vgs is rated for 5V logic-level drive.

Which diode are you using?