Wallace and Gromit said:
Steven Burke was the #2 IP man in Beijing. He was the 5th man in the TP squad.
I don't know what the limits were on track team numbers in 2008. They were certainly so tight in 2012 that the French registered Bourgain (Team Sprint and Kierin) in the road squad (he climbed off after the neutral zone!) and the Germans registered Forsterman (also a sprinter) as a mountain biker.
There may have been similarly tight limits in 2008. I recall talk that Cav was in the frame to be a sub in the TP squad if required. He was a low 4:20s IP man in those days, and would presumably be able to deal with the fast start required in a TP.
I think Hayles simply wasn't good enough to make the cut.
Beijing qualification lists:
It was a relatively complicated system - GB were allowed a theoretical max of six 'endurance' riders, but could only declare 5 for the Team Pursuit - in addition, Wiggins as world champion had a 'non-transferable' place in the IP - i.e. he had to get one of the IP places. - since they clearly wanted to declare Wiggins for TP as well - in effect it meant they could have taken Hayles for IP only - but they only had one 'other' IP place come what may - so essentially Hayles had to be within the top 5 anyway.
As for Madison, GB was allowed a team of two, full stop - and it had no bearing on the broad 'endurance' squad. They and the points race places were, it seems, calculated entirely separately from pursuit.
In 2012, UCI/IOC added the extra foible of restricting overall squad size regardless of qualifiers (9 males, 7 females max per track squad). This meant that, in effect the 'big countries' - AUS, GB, Fra and GER in the sprints, had to take their individual riders from their team events - although usually they'd want to anyway. People selected in other cycling disciplines were also allowed to cross over, as it didn't add to numbers - as memory serves, Shanaze Reade from BMX may have been Man One back up for Jess Varnish in women's sprint.
It should be said at this point, that these are not problems that Irish track cycling tend to encounter, more's the pity.