The search of your wallet was a valid / legal search because this was a search incident to an arrest.  No search warrant is required.  The reasons for a search incident to an arrest are to look for contraband or any weapon and to take inventory of the contents of your wallet in case you claim in the future that items are missing from your wallet.