WTF is going on in here?!?!?!?!
That's a Watts Thermal expansion Ball Valve Shutoff.
It's dumps water when thermal expansion is present, or is malfunctioning which could easily be the case.
Hard pipe copper out of that tank on the cold side, tee off and install a thermal expansion tank and get rid of that valve, install a normal ball valve.
Then reconnect back to that PEX.
Before you do any of this, check your static water pressure at a hose bibb and determine what the pressure is incoming.
If it is above 60, near 80, you got other problems as well.
An expansion tank will provide protection to as little as 1/2 pound of deflection on the bladder, that cannot be achieved with that valve, which is not good at all for the life and longevity of your plumbing system.