"could have" vs "could"
We say that could is sometimes the past of can. If that's true then why can't we use it in the following context.
They didn't let us. We could walk.
Instead we say:
They didn't let us. We could have walked.
But we can say:
Listen! I can hear something.
I listened and I could hear something. Why not "I listened and I could have heard something"
Per the top answer to this question, there's a tendency in many languages for words to shift in meaning between probability and desirability, where probability covers what englishclub.com define as zero/first/second/third conditional modes (certain/probable/possible/impossible).
The "core" sense of can/could involves capability, which is part of the probability/desirability issue, so along with other modal verbs it has many inconsistencies and idiomatic meanings.
Turning to OP's specific examples...
"They didn't let us. We could walk." is perfectly valid, given an appropriate context. For example, we tried to borrow wheelchairs from the hospital, but because we were capable of walking they wouldn't let us have them.
"They didn't let us. We could have walked." is harder to contextualise sensibly, but it can be done. Maybe we were in a pub where they wouldn't let us smoke indoors, and we were so angry we could have walked [out] (but we didn't, because we wanted a drink more than a smoke).
"I listened and I could hear something." is a fairly straightforward usage, where "I could hear" emphasises I was able to hear more than a simple "I heard" would.
"I listened and I could have heard something." is a more complex usage. In this case, could doesn't have the sense of having been capable of hearing. It's being used to indicate a (relatively low) degree of probability. So low, in fact, that the speaker is expressing uncertainty as to whether he did in fact hear anything or not. But in that particular case, it's at least possible something was heard.
The list of alternative meanings attaching to could, and could have could and probably does fill a book. As Lynn has noted, present/past tense may imply different meanings, but...
It was so loud I could hear it (loud enough that I was able to, and did in fact hear it)
It was so close you could touch it (but you didn't, you probably weren't even there)
It was so close you could have touched it (again, you didn't actually touch it)
I was so upset I could have cried (but by implication I didn't actually cry)
It's important to note that the second and third examples there mean exactly the same thing in most contexts. Only a pedant would worry about mixing the tenses - you didn't touch it anyway, so it really makes no difference when you didn't do what you never did.
TL;DR: Present tense could often means you are capable of doing something - and possibly that you have just done, are doing, or are just about to do it. Past tense could have often means you were capable (but didn't), but it may express uncertainty about whether you actually did (or unwillingness to say whether you did or didn't).
It's a question of whether something did happen or was only possible. Here is a good resource explaining how to use 'could have'. In particular for your examples:
We can use 'could have' to talk about something somebody was capable of doing but didn't do.
This applies to your example: "We could have walked."
Whereas 'could' is used more as a simple past tense.
I can hear something scratching in the wall! (right now)
I could hear something scratching in the wall. (yesterday)
There is also another use of 'could' for capability in the present tense:
The bus broke down, but we could walk instead.