Android M or Marshmallow does not automatically select the actions of the USB port - it needs be adjusted by the user, depending on the task at hand. Thus the steps are:
Connect the Moto Z to a computer using the data cable.
Swipe down from the top of the screen, and among the notifications appears the option to manage the USB port. It is likely set to charging. In the screen shot on the left, it indicates the current status is 'USB charging this device. Tap for more options.'
Tap on the notification to proceed to the next screen.
Choose the appropriate option to use your phone as a cellular hot spot.
Or internally to the phone, choose to be a Wi-Fi hotspot, and connect your laptop to the Wi-Fi signal generated by the phone.