In law school, we were taught that a professional has obligations that go beyond his or her own self interest. Unlike a real estate developer or a widget manufacturer, an attorney has an obligation to do what's right for the client even if that causes the attorney to lose money or imposes a competitive advantage. Attorneys, for example, can't engage in the kinds of advertising speech that would be entirely lawful if done by a car dealership or furniture store.
This traditional definition is hundreds of years older than the bar exam or ABA code of ethics, and older than formal graduate law school (a 20th Century American invention). All of that came later, after lawyers understood themselves differently.
I would encourage people who write code -- software engineers, developers, coders, hackers, however one chooses to describe this work -- to think of themselves as professionals with obligations that go beyond their own self interest.