Yes it's legal! Every job I've ever had even my most recent job as a seasonal tax preparer has withheld my first week paycheck and unemployment does also.
Your employer is not withholding a check he is just getting you in sync with the payroll system. Most companies take a week, after you work, to pay you.