You can also build it in edit town. I have done that although mine is generally remodeling.
Just do the same as you would with building a house. You have changed the lot, now go to the building icon and build the gym, or whatever you want. You can even, as I have done lots of time, use buildings from other towns.
I don't remember what the choice is, but when you go to build it is there with the options to put in a basement, pond and such.
Or save the building, same as you would save a house you made; it will go in the community bin (I think that is what it is called) where there are houses, empty house and I think it is a bench icon. Just place it where you want it to be on a community lot with the move option, has to be the same size or bigger. Then bulldoze the old building.
When you have finished it, it is a community building and you haven't paid anything for it, the "programing" has.
I'm sure I give more detailed info than is needed. I can tell by number of posts a new member to the forum, but that doesn't mean you haven't played the game a lot and already know lots of info and I have just bored you to tears.
I know that somewhere in the guide there has to be a section that can give better info than what I telling you. Not good at giving links to areas for some reason, they don't work.