Insider trading is essentially in a nutshell the trading of stocks or securities of a company/corporation by a person or persons with knowledge or information about the company that is not public knowledge.
In most cases insider trading is legal. However, the practice becomes illegal when “material” non-public information is obtained and used to provide an edge or advantage. This is particularly targeted in the USA and Germany where the trader is of substantial position, and owns a significant portion of the company’s equity securities.
One of the most profitable practices for inside traders, and one that is legal, is to profit from open market repurchases.
Why it is not allowed?
It hampers Integrity of Capital Markets, the underlying principle is that information asymmetry should be minimized and any rational investor should have fair play in markets.
Government has strict laws against it because Insider trading leads to market manipulation, the ultimate losers are small investors which act on public information.