Staple can be both a noun and an adjective. In these two sentences, it's a noun, unlike main and basic, which are adjectives. In the case of the first sentence, it's 'the thing chiefly “dealt in”; the principal object of employment, thought, or discourse. Sometimes . . . used for: The chief component element, the "substance", "bulk".' In the case of the second, it's 'a principal industrial product of a country, town, or district; occasionally the commodity principally dealt in by a person or class of persons. Also, the principal or basic food on which a community lives.' Both definitions are from the Oxford English Dictionary.