A couple of things - I agree, the valve should be properly supported and it's not. But, unless there's a backflow preventer in the sprinkler system, it is both illegal and dangerous. In most places, that backflow preventer must be tested and recertified annually, or the water company will shut your water off. I'm not sure if the connection to it is to code, either, but I'm not a pro. Normally, pvc (at least that looks like pvc) is not allowed above ground. It can get brittle and crack from UV exposure over time and it's pressure rating decreases radically when it gets hot - the sun can heat it considerably (which is why it's okay underground...the temp and UV exposure are limited).