Environmental policies often aim to mitigate contaminant harm by adhering to a regulatory threshold. A key example is managing nitrate—a prevalent contaminant from agricultural fertilizers—in groundwater. While increasing drinking water well depth is an effective intervention, it incurs significant costs. Policymakers must therefore determine the minimum well depth required to meet the regulatory threshold. In this paper, we propose a policy learning framework to identify the minimum treatment level needed at a given location to meet the threshold. A key feature of our method is accounting for the spatial dependence of contaminants. We estimate the optimal policy by empirical risk minimization with a novel, nonparametric, doubly robust loss function and provide a cross-fitting SVM estimator. We then characterize the statistical properties of the estimated policy in terms of the excess risk bound. Our policy outperforms competing methods, including non-spatial policy learning and indirect methods, in our simulation studies. Finally, we apply our method to design a well replacement policy for Wisconsin, aiming to decrease the nitrate level in drinking water to the 10 ppm regulatory threshold.