Why are the times of day and night not measured by the rising and setting of the sun and the moon, respectively.
Because the steam engine was invented. That invention gave us the rail system. The train schedules changed our way of measuring time, which was "sunup to sundown" prior to the Indurstrial Revolution.
In the Muslim world, times are (or were) measured by the sun. That means a Muslim watch makes adjustments from day to day.
In the West, since the Industrial Revolution there has been shift work, so we standardized on a 24-hour day. And astronomers prefer a fixed 24-hour day.
Other people asked questions on similar topics, check out the answers they received:
Other people asked questions on various topics, and are still waiting for answer. Would be great if you can take a sec and answer them