This bill being defeated is the best thing that could have happened for Trump. If it would have passed he would have surely lost the next election (if he lasts that long) with the problems that would have arisen from the new bill. He now can watch Obamacare continue to struggle with huge rate increases and then act in unison with the some  Democrats to replace it. At the same time he sends a loud message to the right wing Republicans that he can work without them.  I don't see it as that big of a loss for Trump at all.