Did you have a return ticket scheduled and could prove you had the necessary funds to sustain yourself? From what I have read/watched those in combination with the "ties to home country" check are the biggest red flags for CBP.
Not the OP but it's likely the question he is referring to happened at the consulate not at the port of entry. Buying a ticket without a visa (as I did once) was pretentious and therefore my visa was denied
Unfortunately buying a ticket and booking a hotel is necessary in most cases. At the embassy for your first short-term visa and for border control.
I'm a nobody from a 3rd-world country and have always done that with 100% success rate over a decade. I keep visiting the US regularly and I always have a way to somehow ensure I intend to leave the country. The questions at the border keep getting shorter and quicker every time.
Unfortunately, that's how it works, in my experience.
All countries require some confirmation you can pay for the stay and will get out.
Some countries ask for a return ticket and hotel stay - it indicates that the traveller has some means of paying those amounts.
US does not need those before visa issue.
In many cases, people cancel the flight ticket after visa issue; and definitely book a more suitable hotel.
Anecdote time: Interpretation of the guidance is upto the visa issuing officer. Normally they want a ticket getting out of the destination country. But in one case the officer wanted me to 'return' back to the country where I was starting the travel from.
So I had to show him the ticket for the third leg of the flight: A -> B -> C -> A
Sometimes it's even required. I traveled to Nigeria from the US (on a British passport) and needed to turn up to the visa appointment with proof of flights and accommodation.