Why did the Supreme Court declare some New Deal measures unconstituational ?
The major case in which the Supreme Court struck down a New Deal program was the case of Schechter Poultry Corporation v. United States (1935). In this case, the Court struck down the National Industrial Recovery Act of 1933 -- one of the major programs of the New Deal. The Court did so for two reasons.
The first reason was one of separation of powers. The Court ruled that the Congress had given away too many of its powers to the executive branch. This was the case because Congress had let the Executive assign a group to make broad policies (as opposed to Congress making the policies and letting the Executive make rules to implement that policy).
The second reason had to do with the definition of interstate commerce. The Court ruled that the federal government could not regulate Schechter's poultry operation because the chickens involved were no longer part of interstate commerce. Because the chickens had come to "permanent rest" in the state of New York and were not going to cross state lines again, the federal government could not regulate them. (This is because the federal government can generally only regulate interstate commerce, not things that happen solely within one state.)
For these two reasons, the Supreme Court struck down the NIRA.