Again, ruling on the constitutionality of a law is not "legislating from the bench". Laws ruled unconstitutional by the Supreme Court can be revisited, rewritten and resubmitted to the Executive branch. Laws that are found to be constitutional are not changed and stand as law unless repealed by the legislature.What you don't seem to get is that under no circumstances is the SCOTUS allowed to legislate from the bench.
They are to go by the letter, or the intent of the law only.
Not a difficult concept for most people to grasp.