Opening a found wallet to look for an ID is fine. Counting the cash first tells you something.
LEADERSHIP
LEADERSHIP
The order of your actions is its own confession. Looking for a name is the move of someone solving a return; checking the notes first is the move of someone pricing a decision they have not admitted to making yet. You have just learned which question came to you first, which is worth knowing before the next one arrives.
Treat that as a private instrument, not a verdict. When you find something, notice your opening move, then do the right thing anyway, quickly, before the cash becomes a thought. Honest people are not people without the impulse, they are people who do not act on it.
What would you look for first inside a found wallet?
Free, with nothing to buy inside it.