Yes - that is absolutely legal assuming that both parties agree to be compensated with free benefits instead of the money.
You generally must include the value of benefits in your gross income. The benefits are subject to income ans self-employment tax (if you are not an employee).
In general, the amount that you must include is the amount by which the fair market value of the benefits is more than the sum of what the employee paid for it plus any amount that the law excludes. You must determine the value of benefits no later than January 31 of the next year.
If you have any expenses when you performed your work - you may deduct these expenses.
Let me know if you need any help.
I am not sure how would you determine the value of the work you performed and what would be the purposes of that...
but for tax purposes that would not matter - the matter is the monetary value of the compensation you received - that should be included into your income.
For deduction purposes - you need to determine your actual expenses - for instance - if you purchased some tools, supplies, etc, business use of your golf cart, etc.
If you are an employee - you should be paid at least minimum wages (based on corresponding value of benefits you received).
However if you are not an employee, but a contractor - the minimum wages rule would not applied. In this case - if your actual compensation - based on the time spent - is less than a minimum wages - that is what you agree for. You may think about that as a loss of your time - but for tax purposes - that is not a loss.
According to the IRS - that is your responsibility to report any income and determine your tax liability.
If the IRS find out about your income - they might assess additional taxes and penalties and interest if you owe taxes.
That is not the association's liability to determine your taxes. If the IRS gets involved - that would be between you and the IRS.
I suggest to keep a good record of your related expenses - just in case - that would reduce your taxable income.