Voltage Divider give different values
The problem is not your divider, the problem is this is not where you should be using one.

The LM7805 (with a load) in your case can be modelled as a resistance that draws current from your divider. This means the total resistance of the bottom half of your divider has changed, and hence the output you previously calculated has now changed.

Also as mentioned I think the LM7805 is capable of taking a 24V input voltage. Remove the voltage divider and you should not have any problem.