Microsoft founder Bill Gates has said tech companies should be forced to cooperate with law enforcement authorities.