Justice Department lawyers argue in court documents that it is legal for the administration to withhold funding based on partisan politics.