An entity is usually required to have a foreign corporation registration in as state when it "does business" in the state, although ultimately, this is mostly a matter of state law.
The place where the work is done by its officers, employees, and agents would be one place where the company "does business", in this case California. California is the state which is the single most likely to aggressively enforce that requirement because it ties into its Franchise Tax Board tax collection agency's functions.
Usually, it would be optional to register in a state where one sends goods or data via third-party instrumentalities of interstate commerce (e.g. telephones, the Internet, U.S. mail, FedEx), without having an office or employee or agent for the conduct of business there (following the now overruled standard of International Shoe related to general jurisdiction over corporations or other non-residents of a state and the now overruled Quill case regarding sales taxing jurisdiction). This is probably still good law in most cases, although the inquiry would be fact specific and would also depend upon the requirements of state law.
The nature of the services provided over the Internet would also matter.
For example, if you provided advice on Iowa law as a lawyer, from an office in California, to Iowa clients with no connection to California, you would probably be "doing business" in Iowa. But, if you simply allowed people to access your non-Iowa specific data base from Iowa that was maintained in California, you are probably not doing business in Iowa, even if you charge a fee for doing so.