If the past participle of devenir is "devenu" so the "ir" is replaced with a "u", then why is sortir (which also ends with "-ir") replaced with an "i"?
Sortir and devenir have different conjugations. Regular verbs (those whose conjugation obey to a pattern) can be divided into three groups, those with an infinitive that ends in er (like chanter), those with an infinitive that ends in ir (like finir), those with an infinitive that ends in re (like vendre). And there's a bunch of irregular verbs that do not follow a pattern, devenir and sortir belong to those. Some irregular verbs have an infinitive ending in er others in ir other in re, so when you learn a new verb you never can tell if it's regular or irregular at first sight.
When you learn a new verb you'd better check if it's regular or not, and if it's irregular then you know you will have to learn how to conjugate it as you learn new tenses. You can work out the past participle of a regular verb knowing its infinitive, but for an irregular verb you have to learn it when you learn how to conjugate it.
You can have a look and wiktionary's page on French irregular verbs and and this page How to Conjugate Irregular –ir French Verbs. There are lots of sites on the internet where you will find the conjugation of verbs, for example this one.
I'm not sure about the evolution of sortir (the Latin verb it descends from had no participle forms), but the past participle of the verb that evolved into devenir was deventus, which eventually gave the -u in modern french.