President Barack Obama signed legislation Wednesday barring members of Congress, the president and thousands of federal workers from profiting from nonpublic information learned on the job, calling it an embodiment of the fundamental American value of fair play.