Part of the problem is that some prime contractors know that there are subcontractors out there that will agree to work for under the subcontractor's cost of doing business. So the prime will bid the job accordingly to get the job. The simple solution on paper is that If EVERYBODY would only accept jobs that are at or above the subs profit margin, prices would have to go up. However as you know there are all kinds of subcontractors that have no idea what their costs really are until it is too late.
If you are not happy as a subcontractor, you could always become a prime contractor. However, getting a prime contract is not free. I have been both a prime and a subcontractor, so I know the costs for both. In fact, it requires a lot of time, (often years) money (often millions) & effort to get a prime contractor. There is no compensation to the prime until the contract is signed and the first invoice is paid. Remember the years durations I mentioned earlier. The relationships that lead to prime contracts are usually years long, again with no pay. The prime contractor has to pay for the same general liability insurance that you do even though he may not have any employees at the job site(s). Primes also maintain an with office staff. Further some jobs require the prime to have a net worth of multi-millions dollars and some jobs require bond. Bonding costs are about 10% of the jobs gross revenue, right off the top. So as you can see there is much more to being a prime contractor than just sending a bill.
I am not going to get into what percentage a sub should get because everyone has a different business model and you probably dont really know what the prime is getting anyway, since most all prime contracts are confidential by contract and/or NDA.
The best advice I was given as a young contractor in the 1980s was:
1) never work for under your costs & profit margin
2) never lower your prices just to get a job
3) if you are not making enough money, find a different job that pays more, then switch jobs
4) if you do not like the type of work you are doing, find a job that you like, then switch jobs
