Every country I’ve travelled to asks this. They also usually want the address of the place I am staying, and if on business what that business is, who they are, and what I’ll be doing for that work while in-country.
Do I object? No. First, it isn’t my country. Their country, their rules. If I don’t like those rules I don’t go there. Second, that is an entirely valid set of questions to ask; a country should know why people are visiting it.