This depends a lot on how the two companies involved in the contract negotiation operate.
You have to realize that there is always a cost of doing business, and somehow you have to recuperate it from the profits you are making. Think about your daily work, for example. You might work for 8 hours a day, but possibly you are productive and producing an actual result for, say, 6 hours. The rest of the time you might read emails, be in useless meetings, etc. Same for a company, but multiplied by the number of employees and adding to this other things like doing legal stuff that the law requires for example, where you don't actually get a profit from, etc.
Contract negotiations are included in this cost of doing business. It takes time. And time is money. If you win the contract, you can include this cost in the overall price of the contract so you can recuperate your investment. If you don't win the contract, well... that's the cost of doing business and you need to find other ways to recuperate it.
Unfortunately, many customers just send out request for proposals to multiple vendors and then they choose the one that offers the best price and conditions, expecting all of this to be free and only pay the company they sign the contract with. But as you noticed yourself, responding to this request takes time away from the vendor. And time is money.
And now I get back to what I said in the beginning of my answer: this depends a lot on the companies. A vendor might ask for compensation for this, and a customer might understand that nothing is for free and pay something for this effort, even if they don't choose the vendor for implementing the software. But you also have to take into account other aspects. For example, if the vendor asks for payment for the time spent drafting the contract, performing various analyses, estimations, etc, and the customer expects all of this to just be the cost of doing business for the vendor, how do you think the vendor will be perceived by the customer? The contract negotiation will start on the wrong foot, so the vendor may lose the contract before even going into more details or negotiations.
For these reasons, many times, this cost is carried by the vendor. There is inherent risk in doing business. Sometimes you have to take a risk in order to bring in a new customer. You can't always protect yourself from risk or ask potential clients to pay upfront for your own risks.