Judge rules K-12 mental health funding with strings attached is constitutional