Cannot connect to a data connection on Sprint HTC One M8
The same thing happened to me after I rooted and installed CM.

I seem to have just solved it by going into the Access Point Names menu, opening the 3 dot drop down menu and selecting "Reset to Default" and rebooting the phone. I then went back into said menu, clicked the add (+) button and entered a new APN with the settings as follows:

Name        : Sprint
APN         : cinet.spcs
MMSC        : http://mms.sprintpcs.com/servlets/mms
MMS Proxy   : 68.28.31.7 6
MMS Port    : 80
MMC         : 234    
MNC         : 15    
APN Type    : Internet + MMS
APN Protocol: IPv4


I left every other field blank, saved it, selected it from the previous menu and restarted. Everything seems fine now, I've got full LTE where I had sporadic 3G (mosty no signal) in this same spot just moments before. Granted it's only been an hour so time will tell.

Source (and steps for some models): 4GTricks - Sprint APN Settings For Android, Samsung Galaxy, HTC One, Xperia, Motorola Moto, LG G1