An optimal regularity result for Kolmogorov equations and weak uniqueness for some critical SPDEs