Kant does not think there is anything wrong with being beneficent from sympathy. He thinks we have a duty to cultivate sympathetic feelings by participating in the situations of others and acquiring an understanding of them. He thinks we also have a duty to make ourselves into the kind of person for whom the recognition that something is our duty would be a sufficient incentive to do it (if no other incentives were available to us). That's what he means by "the duty to act from the motive of duty".