It is completely legal unless you have a written employment contract which in some way prevents this. In the absence of a contract, you are an "employee at will." An employee at will has essentially no rights at or protection for their job, and can be disciplined (written up or even terminated) at any time, for any reason--including a messy car. The law assumes that if you don't want to work for an employer that does this, you will find a different job.