The comedian was today giving evidence on the second day of his trial against The Mirror in London, after accusing the paper of 'serious libel' over an article that described him as ''racist comedian Frankie Boyle''.
Boyle said that he felt it was "important" to highlight the issue of racism in society by mocking the racists that he "despised" in comedy routines.
He said that his jokes about immigration were meant as a parody of "racism at the heart of British policy", and claimed that they had been taken out of context by the papers.
"I think one of the things about comedy is it's easy to read stories in the papers and think it's a terrible thing for someone to have said but when you see it in the context of the show it can be more easily explained," he said.
Boyle is suing Mirror Group Newspapers, publisher of The Mirror, over an article in the paper last year about Channel 4 considering commissioning a new show featuring the comic.
However, lawyers for MGN have denied that he was defamed by being described as a "racist comedian", and claimed that Boyle exploits negative stereotypes of black people for ''cheap laughs''.
Jurors in the case were today shown footage of an episode of BBC Two show Mock the Week in which Boyle discussed immigration.
In response, the comic said that he was "pretending" to have racist views for the episode, and insisted that he felt it "important" to mock people who actually think like that.
''I don't think British people are racist. I think it is a top down thing. I think you have a lot of rich and Conservative people who control our country who are racist and their views trickle down through things like tabloid papers," he said.
Asked about why he used the word "n***er" on an episode of his Channel 4 show Tramadol Nights, Boyle replied: "Context is everything. If you use this at a dinner party to insult someone that would be a terrible hate crime. It's not a word I would use lightly."
Boyle has consistently denied claims that he left Mock the Week after making a controversial joke about swimmer Rebecca Adlington.
In court today, he expressed his surprise at the reaction, which included 75 complaints being lodged with the BBC, leading to an official rebuke from the BBC Trust.
"There was no malice in the jokes [about Adlington] in particular," he said. "I was really surprised by the Rebecca Adlington thing."
Later, Boyle added: "I had no idea Rebecca Adlington was as famous as she was or that she had been a huge success."
However, he again insisted that he was not sacked regarding the incident, a claim that was repeated in the Mirror article at the heart of the libel case.
"Absolutely not," he said when asked. "The idea you would be forced to quit the show for saying someone looks like they are looking in the back of a spoon, it just seems ridiculous because they just don't sack people on those panel shows."
The trial continues.