BT has been fined £17.5m over network disruption that affected 14,000 emergency calls and led to an "unacceptable risk".