I don't know if this is true on bikes, but my experience has been that if the battery is close to dead (or doesn't have a good connection) it won't have enough juice to spin the starter dog with enough force to make it engage the flywheel. If you took the battery off to charge it, it might not have a good connection.
If that's not the case, it could be a bad starter, broken teeth on the dog or flywheel, wiring, etc.