There are a lot of free tennis courts to play tennis in San Francisco
Here is a Google Map of every public tennis court.
Lisa & Douglas Goldman Tennis Center – has 16 lighted tennis courts and you can reserve these courts for a small fee. See their fee schedule. They also offer tennis groups and private classes.
Bookable free courts in San Francisco using Spotery.com – these courts are part of the free tennis courts and allow you to book 7 day ahead at 8am or 2 days ahead at 12pm. See this site for details https://www.spotery.com/site/sfrp
See this great resource at tenniscoalitionsf.org
Tennis Coalition also offers resources to find other people to play with.