It's to encourage loyalty, like wearing branded clothes, using branded bags, or loyalty programs. This one is very benign though, so I don't find it in any way something to complain about.
A good hotel with good service may get a reference here or there, but a decent hotel that gives you a cute thing to take with you, post pictures of, and tell people all about the cute quirky thing some place or other does?
People do the advertising for them.
It's like the snarky tumblr/twitter/facebook fast food pages.
I manage a hotel and while this would be a small help towards marketing, you're just gonna forget about that duck in when you get home. Maybe you post it on social media or tell a couple friends. Really I am way more interested in the positive impact a small gift like this has with guest satisfaction scores and guest/staff engagement. I bet tons of people talk to the front desk about the cute duck which might give us a chance to recommend a good restaurant or solve a minor issue the guest might not have mentioned to us. It's a unique ice breaker to start a relationship between the staff and the guest which is incredibly important for achieving high guest service scores.
Haha yes sometimes the housekeeping team does have fun with the towels and that's probably more for them then you really. It's a good creative outlet on slower days.