There is a surprising lack of ethics in these answers to a question about ethics! Is X action ethical is always a quagmire, and it is nearly impossible to separate it from your personal values. We can use different ethical frameworks to examine your actions, but ultimately the impact of those frameworks depends on what you already see as good or bad.
Ethics
First off, from an official university perspective, I cannot fathom any way that you would be violating a student/employee/researcher code of ethics by volunteering your time to develop course materials. If that is what you're asking, then consider yourself vindicated. Go volunteer with a clean conscience! If you're interested in actual ethics then read on.
Aristotle's virtue ethics usually considers virtue to be the mean attribute that lies between two extremes (vices). By practicing virtuous actions and emulating people we know to be virtuous, we cultivate our own virtues. Volunteering is usually considered a generous action, and generosity is often recognized as a virtue that lies between the extremes of selfishness (a nothing-is-free mentality) and being prodigal (a sort of naive mentality of giving everything away to anyone who asks). I think this is what the very good answer by Azor Ahai -him- is getting at: is giving your time and energy to the university a worthwhile endeavor? Are you giving foolishly, or wisely? This is really a question that only you can answer for yourself. Azor Ahai -him- provides some arguments for people who see this as a foolish (and therefore not virtuous) use of your time and energy.
On the other hand, we could examine the problem from Kant's categorical imperative: if you could make a rule that describes your behaviour, would applying that rule to everyone else result in a world you would consider better or worse. (This is a simplification, please do not crucify me in the comments for misrepresenting Kant). How would we formulate a rule for this behaviour? Perhaps "Students who want to improve their teaching portfolios and build an academic interest in the material of a course must volunteer their TA services for free." Almost all grad students want to improve their teaching portfolios (if they continue in academia), and many are interested in the course material that they teach as TAs. So then most TAs should be working for free. Does that result in a better world or a worse world? Or "Students who can afford to not be paid must volunteer their TA services for free." Why would I hire a poor student to do this work when a rich student will do it for free? Better world or worse world? Of course this depends on many other factors: are graduate students relying on TA money for their living expenses at your institution? I cannot answer these questions for you. The crux of Kant's ethical viewpoint is that maybe one person acting this way has a minor impact on the university, the other TAs, and/or society as a whole, but if everyone acts this way then there could be serious consequences. Kant invites us to consider these consequences in a structured way.
The final ethical framework in the trio of frameworks taught to undergraduate students is Utilitarianism. This framework looks at whether the action you take maximizes the good results (or sometimes minimizes the bad, depending on the flavour of Utilitarianism). You volunteering your time seems like it would make you happy and satisfied (good!), it would probably make the instructor that you work for happy and satisfied (good!), it would probably make the university administrators nominally satisfied that they don't have to pay anyone (good!). Maybe your volunteering has a minor contribution to depressing TA wages (see Ben's answer) (bad?). Does the good outweigh the bad? How do we measure that? Again, only you can answer this question for yourself based on your personal morals regarding what is good or bad.
TA Unions and Conflicts of Interest
Something else that I am not seeing much in other answers is the teaching assistant (TA) labour legal situation at your institution. At my institution, TA positions, lecturer positions, and non-faculty course instructor positions are unionized. What is or isn't considered unionized work is very clearly defined. Developing and improving course materials is considered either TA work or course instructor work at my institution, though this will vary from place to place. In some departments at my institution, TA work is a mandatory part of the graduate student funding package (graduate students are required to do TA work if they want to receive the full student salary from their department). By volunteering to perform this work for free you personally are not necessarily doing anything wrong, but the university would be opened to grievances (legal action) against them by the union by accepting your labour for free.
This is the de jure reality at my institution. However, the de facto nature of TA work often sees TAs working longer hours than specified in their contracts, or performing extra unpaid duties. Many TAs are graduate students working for professors in their department. Maintaining good relations with these professors is often crucial for the future academic success of these students, especially if they are working as a TA for their research supervisor. Many professors at my institution expect TAs to put in a little off-the-books work when they demand it. A TA who is by-the-book, with a that's-not-in-my-contract mindset will likely sour these relationships. Note that unlike an independent contractor-client relationship, TAs don't get to pick what professors they work for at my institution. They do get to indicate preference, but ultimately they will be assigned wherever TAs are most needed. As a result, whether intentional or unintentional on the part of the professors, TAs can feel coerced into "volunteering."