The problem is that a 1-way C class ticket from LAX to Tokyo is about $2300 vs $1775 from LAX to Shanghai. So when you make a stopover, you must pay the fare to Tokyo and cannot use the "through fare" from LAX to Shanghai. That is, you are not paying for the stopover itself but rather for the fact that with the stopover you have created a new destination - Tokyo - which has a higher fare than Shanghai.
As you indicated, if your stay in Tokyo was less than 24 hours, you would not have this problem, as it would not be considered a stopover. That doesn't help get your fare down, but I hope it explains why you would be paying more.