Being polite pays off.

Literal

Polite-ly do-ing [topic-と] gain-exists.

~すると得である is a formal maxim structure: the conditional/sequential と marks 'when/if you do X,' then the nominal 得 ('gain, profit, benefit') + である ('there is') predicates the result. 礼儀正しくする uses the ~くする ('do/make [adjective]') pattern — 'act politely.'