Making attendance at such a function mandatory, is perfectly legal. The fact is that a company can set the conditions of employment much as it sees fit. This is true absent some form of legally actionable discrimination or if such a requirement violates the terms of a union agreement or employment contract. Additionally, attendance can be used as part of an annual review. That having been said, if you are paid hourly, then you may be entitled to compensation for the time that you spend at this event.