I can understand why propositions that end with r (or bei) do not allow for such contractions, but I fail to see why not shorten "in der" and "an der" to "ir" and "ar".
There are many possible reasons, but I'm afraid asking "why" a phenomenon in a language behaves as it does is ultimately always in vain - the language is not a sentient being that you could interrogate, and deducing the causes of things through experiment is usually impossible; you can only make clever observation of parallel cases and formulate hypotheses compatible with them.
Here are some possible aspects:
Frequency. Contractions constitute irregular forms, and irregular forms tend to be more common for more frequent forms (e.g. the extremely common verbs "sein" and "haben" are also the most irregular). Since both masculine and neuter nouns can occur in the phrase "in dem XXX" and only feminine nouns can occur as "in der XXX", the bigram "in dem" could be roughly twice as common as "in der" and hence more susceptible to contraction.
Coarticulation. You can move from forming an /n/ sound to an /m/ sound by merely closing the lips, but moving from /n/ to /r/ requires multiple features to change (at least tongue and palate). Maybe contractions that require fewer changes are more likely to recur.
Chance prevalence. Note that the contractions with -m are not the only ones there are. There is also the case of "in"+"das" = "ins", which are about as common as "im", and the case of "unter"+"dem" = "unterm", which is less common; and then there are cases such as "in" + "einem" = "innem", which are not listed by Duden but used a billion times by actual speakers. Clearly there is a continuum from "fully official" all the way down to "ideolectical and non-repeatable" across which forms can exist. The forms with "r" might simply be a bit farther down that continuum due to chance or measurement uncertainty.