Background information
Recurring Payments are marked as expired when the Next Payment Date calculated/set is after the End Date on the Recurring Payment.
For recurring payments such as donations, If the end date on the Recurring Payment is blank, then a Recurring Payment will continue until the status is changed to anything apart from Active. For memberships, the End Date is required and represents the end date of the current period of the membership/subscription.
For Membership/Subscriptions; these are a linked to the Recurring Payment. If the related Account/Contact level Subscription has the Automatic Renewal checkbox set on, then the recurring payment will be extended by another period (e.g year) and the End Date on the Recurring also updated to reflect the new End Date.
Expired Status Issue
What can sometimes happen is when organisations have migrated data from an old system. If the related Account/Contact Subscription does NOT have the "Automatic Renewal" checkbox set PRIOR to the Recurring Payment being processed, then the Recurring Payment will be marked as Expired.
NOTE: If the renewed Account/Contact Subscription has the Automatic Renewal set, then the Account/Contact Subscription Automatic Renewal is updated to being checked. You will need to check the Account/Contact Subscription Field level history and will see Automatic Renewal enabled there. The below screenshot shows the Automatic Renewal being set.
To address other potential issues, use data loader or similar to update the Automatic Renewal checkbox on all Account/Contact Subscriptions that are supposed to be automatically renewed and have a related Recurring Payment.