Because when you eat right before you sleep your body is busy digesting all night and is still in motion looking for more food to process when you wake up, but if you fall asleep empty your digestive system is sitting idly all night and is still idle when you wake up.
Because, in general, we acknowledge the sanctity of a person’s bodily autonomy over the desires of the general populace. This isn’t necessarily true in cases of imminent danger (i.e. we will forcibly restrain and confine a person who is a known and immediate danger to the lives of others), but not getting vaccinated doesn’t place other people in immediate jeopardy.
The medicine travels to the small intestine (or the stomach) and is absorbed into the bloodstream there along with other nutrients in the food.