Yes, you can be fired for this.  In fact you can be fired for any reason or even no reason at all.  This is called "at will" employment.  In turn, you can choose to work for an employer or not, it's your choice.  Exceptions to this would be if there there is a union or employment contract to the contrary or your termination violates stated company policy.  Also, employment discrimination must not be a factor in your termination.  Absent any of the foregoing, your firing does not violate the law.