Why does 身体 mean both "body" and "health"?
身体 doesn't mean health, it just means 'body'.
你身体好吗？ (is your body fine) =  how is your body.
If your body is fine (身体很好), then you are healthy
If your body is not fine (身体不好), then you are not healthy
We have a word for health and it is 健康

How is your health = 你的健康如何？


Are you healthy? = 你健康吗?


Is your body healthy? = 你的身体健康吗?

体格 means 'physique' (the form, size, and development of a person's body) = The condition of one's body, e.g. 体格強建， 体格孱弱 (Strong physique, weak physique)
体格不佳， (one's physique is not great) doesn't mean 身体不好 (one's body is not fine/ not healthy), it just means one's physique is weak e.g. too short, too thin, lack strength, and so on
Edit:
身体健康 (the body's health) doesn't include mental health, which is called 精神健康.
For the health of both body and mind, it is 身心健康 (the health of the mind and body)
Since 健康 can be an adjective or noun 身体健康 can mean 'the body's health' or 'one's body is healthy'