This is a riddle that has been written several times. It is a trick because this has to do with the wording in the riddle. Most people rely upon the words legal and California, but the more important words are widow and man. If a man is married, it is his wife. When the man dies, the wife becomes a widow. So, the man is dead in order for his wife to be a widow.
Therefore, the man can’t marry his widow’s sister because he is already dead. His widow could marry her former husband’s brother in California and there are probably some people who have done that. There is nothing illegal with that scenario. If the wife died, then the man could marry the sister, but he would be a widower.