SpaceX or Space Adventures did not announce exact pricing for the Crew Dragon tourist flight, but the cost per seat is expected to be in the same range of other commercial spaceflight opportunities.
...
I’ve seen estimates of $10 to $15 million.
I’m not sure why SpaceX is doing this. They have better ways of making money like Starlink. Perhaps they want the publicity or to offset the cost of the flight which maybe a test.
That would be my guess - good PR for their launch vehicles. They may be (I hope?) a little reluctant to do too much testing of new tech on manned flights. But I'm sure they learn at least a little bit with every flight. So if you can get someone else to pay while you gain experience...why not?