If you do anything to defam or injur the company that employs you - it is not only an insult but is a violation against your contract. This is gross misconduct and dismissable without notice. They have the right and were totally correct to do this.
People need to grow up - they do not force you to work there - if you don’t like it - go elsewhere or simply don’t apply.