People are not made of iron, and sometimes they get sick. Generally speaking, when they are seriously ill, they are no longer fit to work. Instead, they should seek medical advice and stay in bed in time. So the boss asked you to go back and rest for a few days, hoping you would come back to work when you are well.
Furthermore, if you are still working under unwell conditions, the boss will also worry that you will have physical and safety accidents. This situation will be more complicated to deal with, such as work-related injuries and compensation.
To sum up, the boss is not going to fire you when he sees that you are in poor health, but for your health and to avoid unknown accidents.