Simple test: if the insured died, would you really suffer a loss? California spells it out.
Every person has an insurable interest in the life and health of (Ins. Code §10110):
Themselves. This interest is unlimited, and they may name anyone as beneficiary (§10110.1(b)).
Anyone they depend on, wholly or partly, for education or support.
Anyone who owes them money, property or services that the person's death or illness could delay or prevent. So a creditor has an insurable interest in a debtor's life.
Anyone on whose life an estate or interest vested in them depends.
Insurable interest also exists where there is a reasonable expectation of financial benefit from the person's continued life, or a substantial interest based on love and affection between people closely related by blood or law (§10110.1(a)). An employer has an insurable interest in its directors, officers and employees, but must get the insured person's written consent (§10110.1(c)). Business partners and key employees fit here.
Timing: insurable interest must exist when the policy becomes effective, but need not exist when the loss occurs (§10110.1(f)). If a couple later divorces, the policy still pays. A policy on another person is void if the applicant had no insurable interest when applying (§10110.1(g)).