To take the first two specific examples, the US flag is perfectly appropriate for English and furthermore warns that it's the American English variant being used. So, some of the spelling will be odd and the date order will be... illogical. ( I speak as an Englishman :-) ) . Similarly, the Union flag is a perfectly good signifier for English and/or British English, a language spoken across the British Isles. Exactly no-one looks at that and expects to see Welsh (there's a Welsh flag for that.) Again, the Spanish flag is a perfectly good signifier for Spanish language, and exactly no-one in Mexico will be reasonably offended - but if I were an app developer in Mexico, using a Mexican Spanish variant in my app, I might use a Mexican flag and everyone would know what was meant.
No, there isn't a 1:1 correspondence between languages and flags. No, that does not, in practice, matter very much. A moment's confusion as to whether a Saltire signifies the use of Scots Gaelic or Scots is not a large problem in the scheme of things. Go and worry about something more important.