The competition aspect is pretty commonly worked around - basically every B2B company I know has no compunctions against calling up a competitor, posing as a potential customer, and getting a price quote for competitive research. Or if they have slightly more compunctions, they'll call up a market research firm, hand over some money, and the market research firm will call up all the competitors in the industry, pose as a potential customer, and sell that information back to all the competitors in the market.
I suspect that SpaceX's published price tag is really there to motivate the employees. It's a reminder that Elon's goal is to make spaceflight a mass-market product that an ordinary middle-class citizen can afford, and so he wants that number to go down over time. In many B2B markets without price transparency, there's a tendency towards lazyness on the engineering side; when your revenue comes from how effective your salespeople are at jacking up the price, there's little incentive to focus on small efficiencies that keep the overall price down. Elon wants to keep the focus on small efficiencies so that the price gets low enough that it becomes an everyday thing.