In a grovelling video message posted on Instagram, Miller said it was "time to do right" and pledged to "come back better".
Miller's participation for the New York heavyweight bout on June 1 was already under threat after the Voluntary Anti-Doping Association (VADA) informed both camps of an adverse finding in a drug-testing sample, leading to him being denied a licence for the date at Madison Square Garden.
Miller retained the right to request a further sample and to reapply for that licence to challenge Joshua in what will be the champion's US debut.
However, a second doping violation by Miller meant that fight was off the cards, promoter Eddie Hearn said.
Responding to the initial adverse finding on Tuesday, Miller had written on Instagram that he had "never knowingly taken any banned substance and when I found out the news I was totally shocked".
"My team and I stand for integrity, decency and honesty and together we will stand to fight this with everything we have," he said.
"This was a voluntarily test that I was very happy to do and these results came just one week after another voluntarily test that I had taken which was completely clean."
But on Friday he struck a different tone, telling fans: "I messed up. I made a bad call. (There were) a lot of ways to handle the situation, I handled it wrongly and I'm paying a price for it.
"I messed up a big opportunity and I'm hurting on the inside. My heart is bleeding right now - I hurt my family, my friends, my team, my supporters.
"But, I'm owning up to it. I'm going to deal with it. I'm going to correct it. I'm going to come back better and I'm humbled by the experience."
Miller said boxers "go through a lot" and he did not want to give his fellow fighters a "bad name".
An adverse finding for GW1516, a metabolic modulator also known as cardarine and endurobol, was made in a sample on March 20.
Hearn had already started the search for alternative opponents from the point of VADA's first update, and he wrote on social media on Friday: "We have now received news from VADA that Jarrell Miller has now failed a second separate test for a further substance.
"AJ's June 1 opponent will be announced next week. If you don't think you can beat him clean then delete my number!"
Hearn's Matchroom Sport had long planned to build Joshua's profile in the US boxing market, to the extent that the fight location, which they remain committed to, and Brooklyn's Miller had been selected specifically to maximise its appeal.
It is understood several opponents, including fellow American Michael Hunter, remain in contention to replace Miller.