It's not actually illegal, though it may look a bit suspicious, and marriage does not automatically confer upon your non-citizen spouse the right to remain in the country... you'll need to file a...
The average citizen cannot find out if someone is in the United States legally or not, unless, of course, they ask that person, directly (granted, someone simply saying that they are in the country...
Under the visitor visa to the U.S., you will not be permitted to work for any U.S. companies, and you must depart the U.S. before the date specified on your visa.