President Trump is directing his anger at the wrong people

It's understandable that President Donald Trump is still disappointed and angry that the GOP Obamacare replacement bill he pushed for never even made it onto the House floor for a vote. But so far, he's been directing his anger at exactly the wrong people at exactly the wrong time: courageous conservatives that he will ultimately need to achieve his political goals.

The 18 men from the House Freedom Caucus who refused to "just go along" and back the Republican replacement bill for the Affordable Care Act should be lauded for sticking to their principles and opposing a bill that did little to improve Obamacare. They did this despite extreme pressure from their own party and the White House, plus massive scrutiny from the news media. In other words, exactly the kind of people President Trump needs in his corner because they're just like the Donald Trump who beat the establishment and the news media to win the White House in the first place.

For now, President Trump is still lashing out at the Freedom Caucus like he did Monday night on Twitter:

Instead, the White House should be doing more to recognize and utilize the silver lining in this health-bill failure. We've now seen a stalwart group in Congress that won't wilt under the pressure as long as it believes in what it's doing. And the Freedom Caucus makes no secret of its support for the steep tax cuts President Trump wants as well as his proposed military buildup. The stalwart conservatives in Congress won't just vote for those plans, but they could also act as very strong lobbyists with their fellow House members.

Then there's the really big battle raging now where the White House needs more conservative support than ever: The Supreme Court. The Trump team needs Republicans to be ready to pull out all the stops to get Judge Neil Gorsuch confirmed over what's looking more and more like an inevitable Democratic filibuster in the Senate. It's true the 18 Freedom Caucus members are all in the House, but Senator Rand Paul was a major ally and inspiration for their fight against the health bill. And President Trump will need Senator Paul to buck up his fellow Republican and fellow Kentuckian Mitch McConnell, who, as Senate majority leader, will have to find the courage to use a "nuclear option" and put the Gorsuch confirmation up for a simple up or down vote. This is crucial because the pressure on McConnell to not do this will be extreme, and he's going to need plenty of support from those Freedom Caucus types to feel comfortable enough to break long-held Senate traditions.

The people President Trump should be attacking, perhaps not so publicly, are House Speaker Paul Ryan and the establishment Republicans who had seven years to come up with a better health policy and failed. The White House should actually be furious that the Congressional leadership produced a bill that conservative critics rightfully depicted as the biggest piece of Republican welfare of all time. It was Ryan and company that put President Trump in a bad position, not the Freedom Caucus.

A fan favorite line from "The Godfather, Part II" is "Keep your friends close, and your enemies closer." In this case, the Freedom Caucus really isn't President Trump's enemy. But he should keep them closer just the same.

Commentary by Jake Novak, senior columnist. Follow him on Twitter @jakejakeny.

For more insight from CNBC contributors, follow @CNBCopinion on Twitter.