Laws are in place to protect society. They are not in place to protect against unethical behavior.
For instance, a vendor may sell ice cream as "Premium Ice Cream" or "Gourmet Ice Cream". The law defines what must be included to be termed "ice cream", but does not further define "Premium" or "Gourmet". An ethical vendor would assure that the ice cream he sells as "Premium Ice Cream" went beyond the legal minimum standard and included higher butterfat content, cane sugar (instead of corn sweeteners), etc.
A mechanic could lawfully perform repairs that were not immediately necessary to operate the vehicle safely. An ethical mechanic would inform the customer that such repairs are optional.