Writing someone else's master's thesis: Unethical and illegal?
Think about it this way: Eventually one of those people for whom you write the thesis will be working for your stockbroker and influencing your investments, or working for your doctor or a hospital and influencing your medical care, or working for your government and influencing permits and regulations, or ...

Leaving aside the potential immediate consequences for your "principal" and yourself, you would be making the world a worse place for everyone.

Does that answer your question?