Reverse engineering as a practice is ethically neutral. People, however, can apply it ethically or unethically. Laws governing reverse engineering will vary by nation. In the US, reverse engineering is generally legal if the product was acquired legally and does not violate patent, copyright, or other laws and contracts.
Ethical applications of reverse engineering include those that bring back discontinued products, create interoperability with other products, and make significant improvements over the original. Besides violating laws and contracts, unethical uses of reverse engineering include creating knockoffs of existing products with shoddy quality and sometimes a deliberate attempt to obfuscate the products’ origin to confuse potential customers.