Ruling preserves funding for health care, welfare