IMO given your level of experience as a fairly new diver, you handled the problem you had on your first dive perfectly. First you seemed to have picked the right kind of buddy, from your story it seems as though you were honest about your skill level and your buddy was happy to team up with you without the expectation of your having to try to push your luck to try to impress or keep up with him.
Your second good decision was recognizing the problem and being able to remain (relatively) calm. There are plenty of new divers who would suddenly see what they believe to be an OOA situation and simply bolt for the surface, instead you found your more experienced buddy, made a controlled ascent and surfaced safely. As someone mentioned earlier, its incredible how a relatively minor mishap like this can quickly snowball into a panicked and disoriented diver who now is facing more serious problems.
Your glaring mistake which I now think you see is obvious was A: your decision to carry on with your second dive with a known defective piece of equipment. And you only compounded this mistake by electing not to end the dive when you had the chance.
If I could equate this to an aviation safety story, your actions were fairly equivalent to those of a new pilot (JFK JR. comes to mind as a fairly good example) who was suffering from the dreaded get-their-itis. You were concerned that your buddy (passenger) would be unhappy with terminating the dive early. and since this was going to be one of your rare chances to dive, you were willing to push an obviously bad situation to the point of near stupidity, just because you wanted to be able to squeeze in an extra dive this season.
The most important lesson of this experience is that you were confident enough to no only admit that you may have made an error but even put it out publicly in order to gain some possible opinions or help, which is really one of the most important qualities in forming a truly confident diver.
Did you do something stupid, yes you absolutely did, you may have actually done quite a few things that were rather stupid. But more importantly, Are these the types of mistakes that are made by nearly all new divers? yes they are, and now you have analyzed the mistakes you made, it will only help you to become a much more talented diver in the future.
There are enough unforeseen problems that affect divers underwater every dive, that to knowingly get wet with a faulty SPG was a mistake. What if you had drawn some really crummy old school first stage setup where the HP inlets are the same size as the LP ones. That could of very well explained your frozen SPG and also could of met that the HP inlet was incorrectly connected to a low pressure hose which could easily result in a catastrophic failure to your entire rig while underwateter. To think that you would have ruined your buddies dive by terminating the dive early was also a mistake, believe me you wouldn't have.