It probably doesn't make sense, from a business standpoint, for Amazon to maintain their facilities there if Texas can make them collect sales tax. So Amazon would probably save money by moving the facility. But it still costs money for them to move, which they'd rather not do.
So consider these two options:
A) Amazon is forced to collect sales tax. Amazon moves the facilities to a different state. Texas still doesn't collect sales tax, and also loses 5,000 jobs! Amazon has to pay for new facilities/relocation.
B) Amazon isn't forced to collect sales tax. Amazon stays. Texas retains the 5,000 jobs, but also gains 5,000 new jobs. Amazon doesn't have to pay to relocate.
Either way, the state isn't going to collect sales tax. So why bother enacting the law? It's really a choice between keeping or losing the jobs, not between collecting or not collecting sales tax.
Amazon recognizes this. So rather than both lose money, Amazon proposes to Texas that they invest more in their infrastructure their, create new jobs, and indirectly fund the Texas government through income and property taxes.
(It may also make sense for Texas to pursue enforcement as a way to blackmail Amazon into investing more into their state.)
Politicians would do well to recognize that their actions don't exist in a vacuum. Businesses will react to maximize profits. So even though something might on paper bring in money, it's possible that in reality it will only cost money.