It was just supposed to be a gag.
The cameo would have been in the first Spider-Man movie, not Spider-Man 2, so keep in mind that it was in the very early days of the current era of Marvel movies. The first X-Men movie had just come out, and that was it.
Jackman refers to the idea as just a gag, but given how fans can be, and how much Marvel seems to listen to their fans, it may have established a shared or at least cotigunious universe. Marvel was probably at least a little bit interested in establishing that precedent too.
The quote you are thinking of is this:
Huffington Post: I read where you were saying how much you’d like to act opposite Robert Downey Jr. as Iron Man, but of course the studio rights prevent that. Is there anything stopping you from just walking by in a scene where the character’s name isn’t mentioned?
Hugh Jackman: In the first “Spider-Man” — Kevin Feige reminded me of this — we really tried to get me to come on and do something, whether it was a gag or just to walk through the shot or something. The problem was, we couldn’t find the suit. The suit was stuck in some thing. And so when they were in New York when I was there, we couldn’t get it together. So, you know, I actually asked some high level people about it. Because the optimist in me goes, “Why not? Why can’t we do it? You know, a split cast or whatever?” And someone reminded that the amount of money Fox paid compared to the amount of money Disney paid is very different [laughs]. So how you split that pie up? God knows. But in the comic books, what’s great about it is they’re just mashing together all the time — and it’s awesome. And people are like, “Yeah, well, let’s get this one with that!” And, you know, I still think, one day, there may be an ability to do it.