A federal judge has ruled that the Trump administration cannot put conditions on grants that fund efforts to combat domestic violence or provide access to abortion resources.