I don't think you understand what spam is. I think you're asking if it's keyword stuffing, and no,not on it's own it's not. If you're doing that in conjunction with using the same keyword in page titles, headings, on-page anchor texts, and navigation tags, then it's getting that way, but otherwise I wouldn't give it a second thought. On the list of 100 important things to worry about in SEO, it's about 105.
Sorry i meant keyword stuffing The reason i asked is because i read about the keyword density that 5 times the same keyword in the content is enough for google to know what you talking about. I always looked to the % keyword density and i sometimes placed it also in the alt and the image title if it was relevant. So is this still oke? <img src="image.jpg" alt="seo" title="seo">
If the alt tag describes the image it cannot be considered spam. I don't recommend try any blackhat tactics with alt tags. It doesn't help too much to rank higher while the risk of penalization is significant.
It is quite common and acceptable to have the alt and title "attributes" of an <img> HTML element have the same values. There is nothing wrong with that. Lots of templates for various CMSs and blogs do this. Ideally the alt attribute will describe the image itself for accessibility purposes (screen readers for the blind). But unless you're stuffing lots of keywords into those attributes (especially alt) then you likely have nothing to worry about.
Google does not take alt tags, image names or the image title into account when trying to determine the keywords of a site. I understand that it has little effect on the search engine algorithms, although saying that, I'd be a little hesitant about that, given that google has a bot for images alone. Can't see thouh how it would affect keyword density, as Bots look more for keywords in the main body of the text, take bold/ h1 keywords into account more and linked keywords buried in the body of text as written in stone (so to speak). Put the page in question through keywordcloud (do a google search) to see what it returns.
I've recently started using title text as well as alt text as alt text doesn't show up in Firefox when you hover whereas title text does. Personally, I use the same description - if alt text describes an image ok in ie then it should be the same for firefox - for the user's benefit - although I work keywords in (in moderation) for seo where possible.