The crop sensor camera has a smaller imaging sensor compared to full-frame cameras (36 x 24 mm). The implication for a crop sensor camera is a smaller mirror, which permits the use of EF-S lens (short back-focus). Hence, if you purchased the EF-S 17-55 F/2.8IS USM, that lens would be fully compatible with your 500D, but not with cameras like 5D, 1D etc. On the other hand, EF 17-40 F4L USM is compatible with all Canon Digital EOS bodies.
Your question appears to pertain to image quality chiefly. Indeed, the EF 17-40 F4L USM offers a much better image quality compared to EF-S 18-55 F/3.5-5.6 IS, especially in the corners and in terms of the colour output. However, what you would definitely realise is that the EF 17-40 F4L has a shorter range than the EF-S 18-55, and hence perhaps a limitation to your craft and art. There are people who like the EF 17-40 F4L over the kit lens, primarily because of the output and that they could live with the range. L lens do offer much more than just image quality; they have better ergonomics, weather-sealing, full-time manual focus and a much faster focus due to its Ring USM design. However, given the aperture of the lens and its range, I doubt you could get more in terms of creative opportunities, where you want greater depth of field or the ability to shoot under low-light conditions or what.
In short, I don't think the difference between EF 17-40 F4L and EF-S 18-55 F/3.5-5.6 is any significant, unless you are really, really craving for better image quality (print anything?). You might as well get a EF 24-105 F4L IS USM (albeit you will lose some wide-angle) and gain greater range, IS and a more versatile lens. (versatility is subjective depending on shooting style)
And since you said you are new to photography, it might (I think) be too early for you to invest in such expensive lens. Perhaps a EF 50 mm F/1.8 ($130 at most) which is unbeatable with regards to its image quality: cost ratio? The huge aperture and small size definitely helps.
Just my 2 cents.