This was television so morally murky it made for fascinating, challenging viewing - but it kept up the propulsive pace of a thriller.